登录“root"后,WinSCP 连接到 Amazon AMI EC2 实例更改用户 [英] WinSCP connect to Amazon AMI EC2 Instance changing user after login to "root"
问题描述
我仔细地按照此处的说明进行了操作,但是我没有正确地进行此操作.这是我所做的:
- 运行 WinSCP 输入主机名(我的实例的弹性 IP)
- 输入用户名ec2-user"
- 输入公钥文件
- 为协议选择 SCP
- 在 SCP/Shell 设置下,我选择了sudo su -"
- 点击登录
- WinSCP 要求我输入密码,点击 OK
- 显示此错误
<块引用>
跳过启动消息时出错.你的shell 可能不兼容应用程序(推荐使用 BASH).
注意:这适用于 Putty
WinSCP 不支持需要终端仿真或用户输入的命令.
参见:http://winscp.net/eng/docs/remote_command#limitations
由于 sudo su -
需要密码,所以它不起作用.
有一种解决方法:在没有提示输入密码的情况下进行 root
登录.您可以通过编辑通常位于 /etc/sudoers
的 sudoers 文件并添加:
root ALL=NOPASSWD: ALL
不用说,这不是一件好事 - 原因应该很明显:)
I followed instructions here carefully however I haven't get this working right. Here is what I did:
- Run WinSCP enter Hostname (Elastic IP of my Instance)
- enter username "ec2-user"
- enter public key file
- chose SCP for the protocol
- Under SCP/Shell settings I chose "sudo su -"
- Hit Login
- WinSCP asks me for passphrase key, Hit OK
- Shows up this error
Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).
NOTE: This works on Putty
WinSCP does not support commands that require terminal emulation or user input.
See: http://winscp.net/eng/docs/remote_command#limitations
Since sudo su -
expects a password, it wouldn't work.
There is a way around it: make root
logon without being prompted for a password. You can do this by editing your sudoers file usually located at /etc/sudoers
and adding:
root ALL=NOPASSWD: ALL
Needless to say, this is Not a Very Good Thing To Do - for reasons which should be obvious :)
这篇关于登录“root"后,WinSCP 连接到 Amazon AMI EC2 实例更改用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!