Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经设置了一个 ec2 实例,但我能够以 ssh centos@ipaddress 的身份 ssh 进入它 我如何以 root@ipadrress 的身份 ssh?我已经更改了 PermitRootLogin 是的,但这没有帮助。请建议。
执行以下任一操作,
i)使用密钥对登录
将密钥对的公钥复制到/root/.ssh/authorized_keys文件中。公钥将在/home/centos/.ssh/authorized_keys(centos默认用户)中可用。此文件的权限必须设置为600.
/root/.ssh/authorized_keys
/home/centos/.ssh/authorized_keys
centos
600
ii)使用密码登录
root
PasswordAuthentication yes
/etc/ssh/sshd_config
sshd