ssh連接localhost被拒絕

報的這樣的錯

ssh: connect to host localhost port 22: Connection refused

按照hadoop官網上的操作

  $ ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
  $ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
  $ chmod 0600 ~/.ssh/authorized_keys

還是不能連接

查看ubuntu機器上的ssh應該是隻有ssh遠程訪問的客戶端,而沒有ssh-server,故安裝openssh-server

$ sudo apt-get install openssh-server


搞定

$ ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:7FTkHoAyQ9yLqfLXI+GOOz/Ej7uBe1vJldjpsej+OuM.
Are you sure you want to continue connecting (yes/no)? no


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章