首页 > 其他 > 详细

scp出现ssh port 22: Connection refused 问题解决具体步骤

时间:2014-06-27 07:06:30      阅读:7680      评论:0      收藏:0      [点我收藏+]

[root(0)@sys11 09:20:29 /home/work/Code_release/bj]# scp ./release.sh  root@192.168.161.151:/Users/a2014102/Downloads
ssh: connect to host 192.168.161.151 port 22: Connection refused
lost connection



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:



  1. $ ps aux | grep ssh  

  2. # 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:



  1. sudo apt-get install openssh-client  

  2. 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



  1. sudo /etc/init.d/ssh restart  

 

to stop it type


  1. sudo /etc/init.d/ssh stop  

 

to start it type



  1. sudo /etc/init.d/ssh start  

 以下是主要的关键步骤:

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:

bubuko.com,布布扣

 

Click on sharing and enable Remote Login:
bubuko.com,布布扣

This will start up OpenSSH server automatically.

 

直接关掉就保存了,因为mac是时时保存的。

scp出现ssh port 22: Connection refused 问题解决具体步骤,布布扣,bubuko.com

scp出现ssh port 22: Connection refused 问题解决具体步骤

原文:http://4617353.blog.51cto.com/4607353/1431015

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!