1. 程式人生 > >ssh連線localhost被拒絕的解決方法

ssh連線localhost被拒絕的解決方法

在終端輸入ssh localhost
報的這樣的錯
ssh: connect to host localhost port 22: Connection refused
按照hadoop官網上的操作配置好ssh以後還是報這個錯誤
檢視Linux機器上的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:XsfMvgjvI+PYquEdgGRRHg6AGAyPVong/vLtGMzxWZk.
Are you sure you want to continue connecting (yes/no)? no

在這裡插入圖片描述

然後就搞定了.