日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > linux >内容正文

linux

linux ssh基本

發(fā)布時(shí)間:2024/4/14 linux 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux ssh基本 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

用于遠(yuǎn)程連接 ?Secure ? Shell ?Protocol

默認(rèn)端口 22 ?協(xié)議版本 ssh2

主要包含 ssh遠(yuǎn)程連接 ? SFTP服務(wù)

服務(wù)端OpenSSH

# rpm -qa? openssh ?openssl

openssh-5.3p1-94.el6.x86_64

openssl-1.0.1e-15.el6.x86_64 ? ? 負(fù)責(zé)加密

進(jìn)程

# ps -ef | grep sshd

root? ? ? ?1243? ? ? 1? 0 19:06 ?? ? ? ? 00:00:00 /usr/sbin/sshd

支持RSA DSA密鑰

公鑰Public ?key ? ?密鑰Pivate ?key

1.X版本

# less /etc/ssh/sshd_config ?配置文件

# grep ServerKey? /etc/ssh/sshd_config ? ? 臨時(shí)公鑰

#ServerKeyBits 1024

# ssh? root@192.168.10.10 ? ? ? ? ? 會(huì)接受服務(wù)端的公鑰

The authenticity of host '192.168.10.10 (192.168.10.10)' can't be established.

RSA key fingerprint is c6:94:5f:af:17:75:7f:dd:bc:2a:54:83:f3:5a:d2:dc.

Are you sure you want to continue connecting (yes/no)?

客戶端會(huì)生成 ? Private ?Key ? ? ? ? ? ? ? ? ? ?# cat /etc/ssh/ssh_config

# ll ~/.ssh/known_hosts

-rw-r--r-- 1 root root 395 4月? ?3 19:37 /root/.ssh/known_hosts

ServerKey ?+?Private ?Key ? ? =Key ?pair ? ?生成此密鑰對(duì),,,,通過(guò)此交換數(shù)據(jù)

危險(xiǎn): ?此后交換數(shù)據(jù)不檢查 key pair


Version ?2 多加了一個(gè)確認(rèn)聯(lián)機(jī)正確性的Diffie - Hellman 機(jī)制

檢查數(shù)據(jù)的來(lái)源是否正確。


基于口令

基于密鑰 ? ? ? ? ? ? ? ?

# netstat? -lntup | grep 22

tcp? ? ? ? 0? ? ? 0 0.0.0.0:22? ? ? ? ? ? ? ? ? 0.0.0.0:*? ? ? ? ? ? ? ? ? ?LISTEN? ? ? 1162/sshd? ? ? ? ? ?

tcp? ? ? ? 0? ? ? 0 :::22? ? ? ? ? ? ? ? ? ? ? ?:::*? ? ? ? ? ? ? ? ? ? ? ? LISTEN? ? ? 1162/sshd ??

# lsof -i :22

COMMAND? PID USER? ?FD? ?TYPE DEVICE SIZE/OFF NODE NAME

sshd? ? 1162 root? ? 3u? IPv4? 10478? ? ? 0t0? TCP *:ssh (LISTEN)

sshd? ? 1162 root? ? 4u? IPv6? 10480? ? ? 0t0? TCP *:ssh (LISTEN)

sshd? ? 1437 root? ? 3r? IPv4? 11491? ? ? 0t0? TCP 192.168.10.11:ssh->bogon:62818 (ESTABLISHED)


# nmap? ?192.168.10.10? -p1-65535 ?掃描端口

基本命令

# ssh? root@192.168.10.10

# ssh? root@192.168.10.10 ifconfig



# scp ? xx ? ?root@192.168.10.10:/tmp ? ? cp文件 xx 到 ? /tmp

# scp root@192.168.10.10:/tmp/xx? . ? ? ? ?相反


SFTP

# sftp? root@192.168.10.10


put ?/root/xx ? ?/tmp ?上傳 ?加客戶端本地路徑 ? ? ?

sftp> get /root/xx /tmp ? ? ? 下載到本地的當(dāng)前目錄


轉(zhuǎn)載于:https://blog.51cto.com/hequan/1761324

總結(jié)

以上是生活随笔為你收集整理的linux ssh基本的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。