系统:Centos 5.2
1、使用sshd 连接,sftp上传文件出现 failed to open a secure file transfer session错误提示
vi /etc/ssh/sshd_configshift+G跳转到文件尾
Subsystem sftp /usr/libexec/sftp-server #发现这里的路径不对
Subsystem sftp /usr/libexec/sftp-server #发现这里的路径不对
/usr/libexec/目录下没有sftp-server文件,将其修改为正确的sftp-server路径
Subsystem sftp /usr/libexec/openssh/sftp-server
2、重启sshd服务
/etc/init.d/sshd restart
3、从新使用sshd连接,在使用sftp上传文件,OK问题解决了
------------------------------------------------------------------------------------------------------------------
使用ssh在Centos 5.2的发行版上,上传文件出现问题,是因为系统设置了最大session是1所以无法登陆。
[root@localhost ~]# vi /etc/ssh/sshd_config
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server
#MaxAuthTries 1
#MaxSessions 1注释掉这行之后可以正常使用ssh上传文件了
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server
#MaxAuthTries 1
#MaxSessions 1注释掉这行之后可以正常使用ssh上传文件了