2012年6月26日星期二

红人网事

红人网事


将Amazon上申请的EC2主机登录方式由key pair更改为用户名和密码方式

Posted: 26 Jun 2012 06:06 AM PDT

首先,打开Tunnelier,连接EC2主机,打开终端窗口。这是默认的登录帐号是bitnami,我们要将其换成root,在终端里输入以下命令:
# sudo -s -H

(Edit /etc/ssh/sshd_config and set PasswordAuthentication to yes. One way to do this is to enter the command)
取得root身份后,我们到服务器里更改文件 sshd_config,将其中的PasswordAuthentication赋值为yes
# vi /etc/ssh/sshd_config

(then scroll down to PasswordAuthentication.  Press i to go into text insert mode and change the no to yes.  Then press ESC, and type :wq and press enter to save and quit.)
下拉文件到PasswordAuthentication这一行,输入i,进入插入状态,将no改为yes。然后按ESC退出,键盘输入:wq保存这个文件更改。

(Enter the command)  
然后重启SSH服务,以root身份输入如下命令
# sudo /etc/init.d/ssh restart

(if you need to add a user, start with these commands. If you already created your user, make sure that you have set a password.)
如果需要新增账户,按照以下方式来开帐号以及设置密码。如果仅仅是为bitnami增加登录密码,则仅输入以下命令的第二行即可。

# sudo adduser <user>
# sudo passwd <user>

没有评论: