Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Several common errors in ssh login and their solutions

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor shares with you several common mistakes and solutions in ssh login. I believe many people don't know much about it. In order to make you understand better, I summarized the following contents for you. Let's look down together. I'm sure you'll get something.

First, make sure that the ssh service on the server side is on (service shhd start)

Then enter: ssh usrname@serverip (remote login) on the client side

Scp filename usrname@serverip:/URL (remote transmission)

Common problems:

Question one

Failed to link port when ssh logged in

Tip (1):

# ssh 192.168.Please pay attention. Please *

Ssh: connect to host 192.168. Port 22: No route to host

This is because the server is not powered on or the network is not connected (there are many reasons, the simplest one is that the network cable is not plugged in. In addition, it may be the network card down, etc.) if it is the network card down, the corresponding network card ifup try again

Tip (2):

# ssh zhou@192.168.***.**

Ssh: connect to host 192.168. Port 22: Connection refused

This is because the ssh service of the other party's server is not turned on. Just start the service on this server.

How to start the ssh service:

First of all, make sure that the host to be logged in has openssh-client installed (ubuntu has a default installation, if not, sudo apt-get install openssh-client). If you want to open the SSH service on this machine, you need to install openssh-server sudo apt-get install openssh-server.

Then confirm that sshserver is started:

Ps-e | grep ssh

If you see sshd, it means ssh-server has been started.

If not, you can start it like this: sudo / etc/init.d/ssh start

The ssh-server configuration file is located in / etc/ssh/sshd_config, where you can define the service port of SSH. The default port is 22. You can define other port numbers, such as 222, by yourself.

Then restart the SSH service:

Sudo / etc/init.d/ssh stop

Sudo / etc/init.d/ssh start

Then log in to SSH using the following ways:

Ssh zhou@192.168.***.** zhou is a user on the 192.168.roomroom.user * machine and needs to enter a password.

Disconnect: exit

Question 2.

The password is correct when ssh goes to server, but the following information is reported:

# ssh 192.168.Please pay attention. Please *

Root@192.168.***.**'s password:

Permission denied, please try again.

This is because if the user name is not entered, the default is the root user, but the ssh service does not have the ssh permission of the root user by default during the security period.

Solution:

To modify the ssh permissions of root, that is, to modify the / etc/ssh/sshd_config file

Change PermitRootLogin no to PermitRootLogin yes

Question three

The following prompt appears when logging in:

Ssh root@192.168.***.**

@ @ @

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @

@ @ @

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Someone could 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. Thank you. * has changed and you have requested strict checking.

Host key verification failed.

When the server password or other changes occur.

The solution generally needs to delete the things of ~ / .ssh/known_hosts, and then log in.

On the ssh login of several common mistakes and solutions to share here, I hope that the above content can have a certain reference value, you can learn to apply. If you like this article, you might as well share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report