SSH: connect to host localhost or ip addr port 22: Connection refused

 

Solution:
One possible reason is that because the ssh server daemon, or sshd, is not loaded and running on localhost, so any attempt to ssh connect to localhost would fail. I check to see whether ssh and sshd are running by typing the following command:

$ ps aux | grep ssh
# Result: bunch of lines, but none of them is about "sshd", only one line is about "ssh"

 

Result is, I only see ssh running, but not sshd. So I know ssh server daemon is probably not started yet.

First, I verify that I have installed the package “openssh-server” on my fedora box.

Then I check the status of sshd service:

 

You may not have OpenSSH completely installed. Type this in terminal:

sudo apt-get install openssh-client
sudo apt-get install openssh-server

 

Another problem that you could have is that your firewall could be blocking the ssh connection. I use Firewall Configuration to manage my ports and firewall.

 

to restart it type

sudo /etc/init.d/ssh restart

 

to stop it type

sudo /etc/init.d/ssh stop

 

to start it type

sudo /etc/init.d/ssh start

 

来源:http://stackoverflow.com/questions/14847718/ssh-connect-to-host-192-168-1-7-port-22-connection-refused

 

OpenSSH server on Mac OS X

OpenSSH server is part of Mac OS X and you don't need to install any additional package.

To enable the OpenSSH server of Mac OS X, open System Preferences:

 

Click on sharing and enable Remote Login:

This will start up OpenSSH server automatically.

 

来源:http://www.gooze.eu/howto/using-openssh-with-smartcards/openssh-server-on-mac-os-x

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值