1. Install the ssh server
sudo apt install openssh-server
2. Remote Login
Format: ssh username @IP # default port is 22, if your port is not 22, you need to specify -p
ssh -p 22 [email protected] # 等价于 ssh [email protected], 因为默认的就是22端口
ssh -p 1234 [email protected] # 这个-p 参数就不能省略(virtualBox安装的虚拟机)
ssh [email protected] # 使用这个第一次登录 ssh 会提示:SSH 告知用户,这个主机不能识别,这时键入"yes",SSH 就会将相关信息,写入" ~/.ssh/know_hosts" 中,再次访问,就不会有这些信息了。然后输入完口令,就可以登录到主机了。
Use ssh access, such as access errors. You can see whether the file ~ / .ssh / known_ssh try to delete the file resolved.