Ubuntu14.04使用有一段时间了,今天图方便,想在工作机上使用SecureCRT远程登陆笔记本.
要ssh远程,首先需要安装ssh服务:
1
| xxx@ThinkPad-X100e:~$sudo apt-get install ssh
|
然后启用root账号,给root账号设置密码:
1
| xxx@ThinkPad-X100e:~$sudo passwd root
|
ssh等一般默认就设置就可以了,如果需要个性化端口等设置,google一把设置方法.安装完重启系统或者使用命令启动ssh服务:
1
| xxx@ThinkPad-X100e:~$sudo service ssh start
|
接下来使用secureCRT登陆,居然提示认证失败,各种设置密码,还是同样提示.google一把说Ubuntu14.04默认做了限制,需要修改/etc/ssh/sshd_config
这个文件.
/etc/ssh/sshd_config
原始内容如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| Package generated configuration file See the sshd_config(5) manpage for details
Port 22 Use these options to restrict which interfaces/protocols sshd will bind to
Protocol 2 HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key HostKey /etc/ssh/ssh_host_ed25519_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600 ServerKeyBits 1024
SyslogFacility AUTH LogLevel INFO
LoginGraceTime 120 PermitRootLogin without-password StrictModes yes RSAAuthentication yes PubkeyAuthentication yes
IgnoreRhosts yes For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no similar for protocol version 2
HostbasedAuthentication no Uncomment if you don’t trust ~/.ssh/known_hosts for RhostsRSAAuthentication
|
将以上登陆验证部分内容修改为:
1 2 3 4 5 6 7
| LoginGraceTime 120
PermitRootLogin yes StrictModes yes
|
保存退出,再次重启sshd服务,登陆ok.
本文标题:Ubuntu环境-使用root账号ssh登陆
文章作者:凹凸曼
发布时间:2014-06-11
最后更新:2021-01-19
原始链接:https://sobaigu.com/ssh-login-ubuntu-with-root.html
版权声明:转载请务必保留本文链接和注明内容来源,并自负版权等法律责任。