參考部落格:
ubuntu預設並沒有安裝ssh服務,如果通過ssh鏈結ubuntu,需要自己手動安裝ssh-server。判斷是否安裝ssh服務,可以通過如下命令進行:
xjj@xjj-desktop:~$ ssh localhost-desktop:~$ vi /etc/ssh/sshd_configssh: connect to host localhost port 22: connection refused
如上所示,表示沒有還沒有安裝,可以通過apt安裝,命令如下:
xjj@xjj-desktop:~$ sudo apt-get install openssh-server
系統將自動進行安裝,安裝完成以後,先啟動服務:
xjj@xjj-desktop:~$ sudo /etc/init.d/ssh start
啟動後,可以通過如下命令檢視服務是否正確啟動
xjj@xjj 621200:00 sshd
621200:00 sshd
如上表示啟動ok。注意,ssh預設的埠是22,可以更改埠,更改後先stop,
然後start就可以了。改配置在/etc/ssh/sshd_config下,如下所示。
# package generated configuration file
# see the sshd(8for details
# what ports, ips and protocols we listen for 22
最後,應該是連線的時候了。請看如下命令:
xjj@xjj.168.158.129
server responded"algorithm negotiation failed
修改ssh的配置檔案 /etc/ssh/sshd_config
在配置檔案中新增:
ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
macs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96
kexalgorithms
diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org
重啟sshd服務後,即可正常連線。
sudo service ssh restart
另外重啟方式還有 sudo /etc/init.d/ssh restart
參考部落格:
linux 上安裝使用git
一.安裝 專案主頁 最先安裝 ssh root下執行 ssh keygen t dsa 生成 pub key root ssh id dsa.pub 二 git使用說明 1 新增git配置資訊 git config global user.name test git config global us...
Ubuntu上安裝SSH應用
ubuntu 8.1上沒有安裝open server服務,需要手工安裝。步驟如下 1 sudo apt get remove openssh client 刪除openssh client 2 sudo apt get install ssh 將安裝open client和open server兩個...
Kali Linux上安裝SSH服務
安裝 ssh 從終端使用 apt get 命令安裝 ssh 包 apt get update apt get install ssh 啟用和開始使用 ssh 為了確保安全 shell 能夠使用,在重啟系統後使用 systemctl 命令來啟用它 systemctl enable ssh 在當前對話執...