2012年8月2日 星期四

[ec2] 開啟 ssh login by password 筆記


使用 ec2 ami 建出的 instance 預設是使用 *.pem 登入的,若是計劃將讓一般的使用者也能登入,就必需修改 /etc/sshd_config:


PasswordAuthentication no

改成

PasswordAuthentication yes

如果需要允許 root 登入可加開(最好是不要,或是你有限制登入 ip 的前題下):

PermitRootLogin yes

改完後別忘了指定新密碼給 root,並重新載入 sshd_config:

/etc/init.d/sshd reload
需注意的是在 /etc 下有二個檔 ssh_config 與 sshd_config,別改錯檔了。
千萬要記得限制可登入的 IP(/etc/hosts.allow 或使用 ec2 security group)


沒有留言:

張貼留言