Ubuntu云版如何通过ssh强制执行“无root登录”?

前端之家收集整理的这篇文章主要介绍了Ubuntu云版如何通过ssh强制执行“无root登录”?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想调整ubuntu云版本默认设置哪里拒绝root登录.

试图连接到这样的机器产量:

maxim@maxim-desktop:~/workspace/integration/deployengine$ssh root@ec2-204-236-252-95.compute-1.amazonaws.com
The authenticity of host 'ec2-204-236-252-95.compute-1.amazonaws.com (204.236.252.95)' can't be established.
RSA key fingerprint is 3f:96:f4:b3:b9:4b:4f:21:5f:00:38:2a:bb:41:19:1a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-204-236-252-95.compute-1.amazonaws.com' (RSA) to the list of known hosts.
Please login as the ubuntu user rather than root user.

Connection to ec2-204-236-252-95.compute-1.amazonaws.com closed.

我想知道在什么配置文件中通过ssh配置了root阻止以及如何更改打印的消息?

老问题,但没有人真的回答你,我有同样的问题:这个配置来自哪里?

它起源于cloudinit,正好在/usr/lib/python2.7/dist-packages/cloudinit/config中的cc_ssh.py中

这反过来又直接依赖于文件/etc/cloud/cloud.cfg.你找到一行disable_root:true.

您应该能够通过调整用户数据来覆盖它并添加行disable_root:false.您的云提供商应该使用户数据可配置.

猜你在找的Ubuntu相关文章