如何使AWS EC2不重置sshd_config文件? [英] How do I get AWS EC2 to not reset my sshd_config file?

查看:146
本文介绍了如何使AWS EC2不重置sshd_config文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想允许密码登录到我的EC2实例。我知道在/ etc / ssh / sshd_config中控制它的是哪一行以及应将其设置为什么。具体来说:

I want to allow password logins to my EC2 instances. I know which line it is that controls this in /etc/ssh/sshd_config and what it should be set to. Specifically:

PasswordAuthentication yes

但是,即使我在保留的主映像上进行了设置,每当将其还原到新实例时,该行上的值仍会重置为 no。这意味着每次启动新实例时,都必须再次手动更改此文件。这使我的实例的自动化距完全自动化仅一步之遥。

However, even when I've set this on a master image that I keep, whenever I restore it to a new instance, the value on the line keeps getting reset to 'no'. Which means that every time I launch a new instance I have to yet again manually change this file. This has made the automation of my instances one step away from being fully automated.

我需要对主映像执行什么操作,以便我从该映像创建的每个实例都可以离开我的sshd_config文件是我喜欢的方式?

What do I need to do to my master image so that every instance I create from it leaves my sshd_config file the way I like?

这是完全配置了专有软件和其他软件的Fedora 16映像。

This is a Fedora 16 image fully configured with proprietary and other software.

推荐答案

如果使用旧的AMI作为图像的基础,则该选项曾经由kickstart文件进行了更改,但据我所知,该选项是在一段时间前删除的。

If you used an old AMI as the basis for your images, that option used to be changed by the kickstart file, but as far as I know that option was removed some time ago.

这几天,AMI最有可能是由 cloud-init 配置的。您应该在 /etc/cloud/cloud.cfg

These days the AMI is most likely configured by cloud-init and if that is the case you should find and change the ssh_pwauth option in /etc/cloud/cloud.cfg

这篇关于如何使AWS EC2不重置sshd_config文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆