ssh connection linux server

Question 1

When connected to the beginning of a new machine Linux-ssh: connect to host 192.168.1.161 port 22: Connection refused

the reason:

The new machine (ubuntu 16.04) is not installed ssh service,

Solution
  • Install ssh service:sudo apt-get install openssh-server
  • Start ssh service: service sshd start
    and then re-runssh username@ip
Question 2

Another host just brush linux, I want to connect via ssh, resulting in a
Linux SSH login server reported ECDSA host key "ip address" for has changed and you have requested strict checking error

Solution:
ssh-keygen -R "你的远程服务器ip地址"

The main reason is to use the same wireless network card, was originally placed on the server, the ip ssh connection that is possible today, the unlimited card change to another machine on the same ip address, so the machine is still considered the original server connections Therefore the connection fails,

Parameter -R

Removes all keys belonging to hostname from a known_hosts file. This option is useful to delete hashed hosts (see the -H option above).

ssh-keygen command to "ssh" generation, management and conversion authentication key, which supports two authentication RSA and DSA keys.

Reference: blog

Published 93 original articles · won praise 0 · views 20000 +

Guess you like

Origin blog.csdn.net/Dream_xd/article/details/103949266