centos – 在WinSCP中使用sudo

前端之家收集整理的这篇文章主要介绍了centos – 在WinSCP中使用sudo前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要更新/usr/local / apache / conf路径中的httpd.conf.

我在cpanel中生成了SSH密钥,并在SSH / Authentication部分的Advanced options中选择了它.

此外,我在本节中尝试了两种不同的SCP / Shell选项(默认情况下,/ bin / bash,sudo su – )

当我提交协议时,我选择SCP.

我可以登录,但是,我得到权限被拒绝的消息,我无法编辑或下载文件.我还尝试为文件夹设置777,为文件设置664,但它也不允许我进行此更改.

我正在使用Centos 6.5.

会话日志:

  1. 2014-01-06 08:23:13.128 Using SCP protocol.
  2. . 2014-01-06 08:23:13.128 Doing startup conversation with host.
  3. . 2014-01-06 08:23:13.182 Skipping host startup message (if any).
  4. ! 2014-01-06 08:23:13.182 stdin: is not a tty
  5. ! 2014-01-06 08:23:13.182 sudo: sorry,you must have a tty to run sudo
  6. . 2014-01-06 08:23:13.182 Server sent command exit status 1
  7. . 2014-01-06 08:23:13.182 Disconnected: All channels closed
  8. * 2014-01-06 08:23:13.241 (EFatal) **Connection has been unexpectedly closed.** Server sent command exit status 1.
  9. * 2014-01-06 08:23:13.241 Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).
我想分享我的解决方案,因为我也在寻找一些解决方法.我现在正在使用CentOS7并试图通过WinSCP(Pubkey Auth)获得连接.

sshd_config中

  1. ..
  2. RSAAuthentication yes
  3. PubkeyAuthentication yes
  4. AuthorizedKeysFile .ssh/authorized_keys
  5. PasswordAuthentication no
  6. UsePAM yes
  7. ..

@CentOS
visudo – 添加以下2个部分

  1. username ALL=NOPASSWD: /bin/su
  2. Defaults:username !requiretty

WinSCP设置:

  1. Disable keyboard-interactive @ SSH authentication settings solves the problem for me.
  2. SCP settings command: sudo su -

猜你在找的CentOS相关文章