連接Linux 提示錯誤信息:the remote system refused the connection
首先查看sshd服務的狀態html
service sshd status
看ssh服務有沒有開啓,沒有開啓爲inactive的話須要開啓服務。java
service sshd start
想讓他開機自動啓動,就chkconfig sshd on。ssh
另外看tcp
iptables -L
看ssh服務有沒有被禁用,iptable服務能夠用iptables -F進行關閉。
spa
一、檢查是否安裝SSH服務,若是沒有
.net
#apt-get install ssh 安裝ssh服務
二、編輯配置文件
code
/etc/ssh/sshd_config 配置文件 Port 3322 #修改端口爲3322(自定義) PermitRootLogin no #禁止root用戶遠程登陸 PubkeyAuthertication yes #容許用key登陸 PasswordAuthertication no #禁止遠程ssh客戶端用密碼登陸
三、開啓3322 端口htm
iptables設置 開啓3322端口容許訪問
iptables -I INPUT -p tcp --dport 3220 -j ACCEPT
另外配置public key 能夠參考連接ip