First, make sure that the SSH service on the server is enabled (Service shhd start)
Then enter SSH [email protected] (Remote logon) on the client)
SCP filename [email protected]:/URL (remote transmission)
Common problems:
Question 1
An error occurred while logging on to the SSH client.
Tip (1 ):
# SSH 192. 168 .***.**
SSH: connect to host 192. 168. ***. ** port 22: No route to host
This is because the server is not started or the network is disconnected (this is a lot of reason, the simplest is that the network cable is not plugged in. In addition, the NIC may be down.) If the NIC is down and IFUP, try again.
Tip (2 ):
# SSH [email protected] ***. **
SSH: connect to host 192. 168. ***. ** port 22: Connection refused
This is because the SSH service of the other server is not enabled. This server enables the service.
How to enable the SSH service?
First, make sure that openssh-client is installed on the host to be logged on (Ubuntu has the default installation, if not, sudo apt-Get install OpenSSH-client ), to enable SSH service on the local machine, install OpenSSH-server sudo apt-Get install OpenSSH-server.
Then confirm whether the sshserver is started:
PS-E | grep SSH
If you see sshd, it indicates that the ssh-server has been started.
If not, start sudo/etc/init. d/ssh start as follows:
The SSH-server configuration file is located in/etc/ssh/sshd_config. Here, you can define the SSH service port. The default port is 22. You can define other port numbers, such as 222.
Then restart the SSH service:
Sudo/etc/init. d/ssh stop
Sudo/etc/init. d/ssh start
Then use the following method to log on to SSH:
SSH [email protected] ***. ** Zhou is a user on the machine 192. 168. ***. You need to enter a password.
Disconnect: Exit
Question 2,
The password is correct when SSH is sent to the server, but the following information is reported:
# SSH 192. 168 .***.**
[Email protected] ***. ***'s password:
Permission denied, please try again.
This is because the root user is used by default when the user name is not entered, but the SSH service does not enable the SSH permission of the root user by default during the security period.
Solution:
To modify the root SSH permission, modify the/etc/ssh/sshd_config file.
Change permitrootlogin no to permitrootlogin Yes
Question 3
The following prompt appears during logon:
SSH [email protected] *****. **
@ Warning: remote host identification has changed! @
It is possible that someone is doing something nasty!
Someone cocould be eavesdropping on you right now (man-in-the-middle attack )!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
76: FB: B3: 70: 14: 48: 19: D6: 29: F9: BA: 42: 46: Be: FB: 77.
Please contact your system administrator.
Add correct host key in/home/Fante/. Ssh/known_hosts to get rid of this
Message.
Offending key in/home/Fante/. Ssh/known_hosts: 68
RSA host key for 192. 168. *****. ** has changed and you have requested strict checking.
Host key verification failed.
Server password or other changes.
Generally, the solution needs to be deleted ~ /. Ssh/known_hosts, and then log on to it.