[Root (0) @ sys11 09:20:29/home/work/code_release/Bj] # SCP./release. Sh [email protected]:/users/a2014102/downloads
SSH: connect to host 192.168.161.151 port 22: Connection refused
Lost connection
Solution:
One possible reason is that becauseSSH server daemon, Or sshd, is not loaded and running on localhost, so any attempt to SSH connect to localhost wowould 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 cowould have is that your firewall cocould 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
The following are key steps:
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:
650) This. width = 650; "src =" http://www.gooze.eu/sites/default/files/screenshots/openssh-001.png "/>
Click on sharing and enable remote login:
650) This. width = 650; "src =" http://www.gooze.eu/sites/default/files/screenshots/openssh-002.png "/>
This will start up OpenSSH server automatically.
You can directly turn it off and save it because the Mac is always saved.