我需要更新/usr/local / apache / conf路径中的httpd.conf.
我在cpanel中生成了SSH密钥,并在SSH / Authentication部分的Advanced options中选择了它.
此外,我在本节中尝试了两种不同的SCP / Shell选项(默认情况下,/ bin / bash,sudo su – )
当我提交协议时,我选择SCP.
我可以登录,但是,我得到权限被拒绝的消息,我无法编辑或下载文件.我还尝试为文件夹设置777,为文件设置664,但它也不允许我进行此更改.
我正在使用Centos 6.5.
会话日志:
2014-01-06 08:23:13.128 Using SCP protocol.
. 2014-01-06 08:23:13.128 Doing startup conversation with host.
. 2014-01-06 08:23:13.182 Skipping host startup message (if any).
! 2014-01-06 08:23:13.182 stdin: is not a tty
! 2014-01-06 08:23:13.182 sudo: sorry, you must have a tty to run sudo
. 2014-01-06 08:23:13.182 Server sent command exit status 1
. 2014-01-06 08:23:13.182 Disconnected: All channels closed
* 2014-01-06 08:23:13.241 (EFatal) **Connection has been unexpectedly closed.** Server sent command exit status 1.
* 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中
..
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no
UsePAM yes
..
@CentOS
visudo – 添加以下2个部分
username ALL=NOPASSWD: /bin/su
Defaults:username !requiretty
WinSCP设置:
Disable keyboard-interactive @ SSH authentication settings solves the problem for me.
SCP settings command: sudo su -