如何登录到 linux 系统
ssh命令用于远程登录上Linux主机。
常用格式:ssh [-l login_name] [-p port] [user@]hostname 更详细的可以用ssh -h查看。
不指定用户,默认使用root账户登录
ssh 192.168.0.11
指定用户:
ssh -l root 192.168.0.11
如果修改过ssh登录端口的可以:
ssh -p 12333 192.168.0.11
ssh -l root -p 12333 192.168.0.11
ssh -p 12333 [email protected]
提示
如果你是第一次登录对方主机,系统会出现下面的提示:
$ ssh user@host
The authenticity of host 'host (12.18.429.21)' can't be established.
RSA key fingerprint is 98:2e:d7:e0:de:9f:ac:67:28:c2:42:2d:37:16:58:4d.
Are you sure you want to continue connecting (yes/no)?
假定经过风险衡量以后,用户决定接受这个远程主机的公钥。
Are you sure you want to continue connecting (yes/no)? yes
系统会出现一句提示,表示host主机已经得到认可
Warning: Permanently added 'host,12.18.429.21' (RSA) to the list of known hosts.
然后,会要求输入密码。
Password: (enter password)
如果密码正确,就可以登录了。