登录“root"后,WinSCP 连接到 Amazon AMI EC2 实例更改用户 [英] WinSCP connect to Amazon AMI EC2 Instance changing user after login to "root"

查看:23
本文介绍了登录“root"后,WinSCP 连接到 Amazon AMI EC2 实例更改用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仔细地按照此处的说明进行了操作,但是我没有正确地进行此操作.这是我所做的:

  1. 运行 WinSCP 输入主机名(我的实例的弹性 IP)
  2. 输入用户名ec2-user"
  3. 输入公钥文件
  4. 为协议选择 SCP
  5. 在 SCP/Shell 设置下,我选择了sudo su -"
  6. 点击登录
  7. WinSCP 要求我输入密码,点击 OK
  8. 显示此错误

<块引用>

跳过启动消息时出错.你的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:

  1. Run WinSCP enter Hostname (Elastic IP of my Instance)
  2. enter username "ec2-user"
  3. enter public key file
  4. chose SCP for the protocol
  5. Under SCP/Shell settings I chose "sudo su -"
  6. Hit Login
  7. WinSCP asks me for passphrase key, Hit OK
  8. 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屋!

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