开发者社区 问答 正文

sftp子系统申请已拒绝求助

用xftp登录出现“sftp子系统申请已拒绝求助”如图:

展开
收起
cys 2016-12-06 07:53:08 9673 分享 版权
3 条回答
写回答
取消 提交回答
  • 旺旺:nectar2。
    回 3楼(cys) 的帖子
    楼主您好,

    好象您启动 sshd 的命令拼写有误喔,

    而在 systemctl status 命令中,显示 sshd 服务是没有运行的状态(inactive)。

    如我的一个系统 systemctl status sshd 输出信息如下:

    $ systemctl status sshd
    ● ssh.service - OpenBSD Secure Shell server
       Loaded: loaded (/lib/systemd/system/ssh.service; enabled)
       Active: active (running) since Thu 2016-11-03 09:57:32 CST; 1 months 3 days ago
    Main PID: 388 (sshd)
       CGroup: /system.slice/ssh.service
               ├─  388 /usr/sbin/sshd -D
               ├─10046 sshd: liujia [priv]
               ├─10048 sshd: liujia@pts/0
               ├─10049 sshd: liujia [priv]
               ├─10051 -bash
               ├─10071 sshd: liujia@notty
               ├─10073 /usr/lib/openssh/sftp-server


    -------------------------

    回 6楼(cys) 的帖子
    您好,

    对比4楼和5楼里的命令输出结果,

    5楼截图里少了  /usr/lib/openssh/sftp-server 这个进程的,

    请问您曾修改过sshd的默认配置文件吗?

    -------------------------

    回 8楼(cys) 的帖子
    您好,

    请问能贴出您的配置文件 /etc/ssh/sshd_config 内容信息吗?

    如是否有这一行:

    # Allow client to pass locale environment variables
    AcceptEnv LANG LC_*

    Subsystem sftp /usr/lib/openssh/sftp-server



    -------------------------

    回 11楼(cys) 的帖子
    您好,

    在我的 Debian 7 系统里, /etc/ssh/sshd_config 配置文件内容如下:

    # Package generated configuration file
    # See the sshd_config(5) manpage for details

    # What ports, IPs and protocols we listen for
    Port 22
    # Use these options to restrict which interfaces/protocols sshd will bind to
    #ListenAddress ::
    #ListenAddress 0.0.0.0
    Protocol 2
    # HostKeys for protocol version 2
    HostKey /etc/ssh/ssh_host_rsa_key
    HostKey /etc/ssh/ssh_host_dsa_key
    HostKey /etc/ssh/ssh_host_ecdsa_key
    #Privilege Separation is turned on for security
    UsePrivilegeSeparation yes

    # Lifetime and size of ephemeral version 1 server key
    KeyRegenerationInterval 3600
    ServerKeyBits 768

    # Logging
    LogLevel INFO

    # Authentication:
    LoginGraceTime 120
    StrictModes yes

    RSAAuthentication yes
    PubkeyAuthentication yes
    #AuthorizedKeysFile    %h/.ssh/authorized_keys

    # Don't read the user's ~/.rhosts and ~/.shosts files
    IgnoreRhosts yes
    # For this to work you will also need host keys in /etc/ssh_known_hosts
    RhostsRSAAuthentication no
    # similar for protocol version 2
    HostbasedAuthentication no
    # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
    #IgnoreUserKnownHosts yes

    # To enable empty passwords, change to yes (NOT RECOMMENDED)
    PermitEmptyPasswords no

    # Change to yes to enable challenge-response passwords (beware issues with
    # some PAM modules and threads)
    ChallengeResponseAuthentication no

    # Change to no to disable tunnelled clear text passwords

    # Kerberos options
    #KerberosAuthentication no
    #KerberosGetAFSToken no
    #KerberosOrLocalPasswd yes
    #KerberosTicketCleanup yes

    # GSSAPI options
    #GSSAPIAuthentication no
    #GSSAPICleanupCredentials yes

    X11Forwarding yes
    X11DisplayOffset 10
    PrintMotd no
    PrintLastLog yes
    TCPKeepAlive yes
    #UseLogin no

    #MaxStartups 10:30:60
    #Banner /etc/issue.net

    # Allow client to pass locale environment variables
    AcceptEnv LANG LC_*

    Subsystem sftp /usr/lib/openssh/sftp-server

    # Set this to 'yes' to enable PAM authentication, account processing,
    # and session processing. If this is enabled, PAM authentication will
    # be allowed through the ChallengeResponseAuthentication and
    # PAM authentication via ChallengeResponseAuthentication may bypass
    # If you just want the PAM account and session checks to run without
    # and ChallengeResponseAuthentication to 'no'.
    UsePAM yes
    UseDNS no
    AddressFamily inet
    PermitRootLogin yes
    SyslogFacility AUTHPRIV
    PasswordAuthentication yes




    2016-12-07 09:49:03
    赞同 展开评论
  • cys
    回 1楼51干警网的帖子
    看了,但是没有看到有解决方案;我的是centos;我的服务器打开有13个错误,
    如图:

    我根据:云服务器 ECS CentOS 7 下重启 sshd 服务操作方法,重启服务器后,还剩一个错误;
    如图:

    但是我 查看 sshd 服务是否启动,提示的是
    如图:

    我查看我的shh版本是
    如图:

    不知何解,不知道那个错误提示是否是原因,请指教。

    -------------------------

    回 1楼51干警网的帖子
    更正一下,查看 sshd 服务是否启动,提示的是

    -------------------------

    回 4楼dongshan8的帖子
    您好,感谢关注!我打开sshd.service 后故障依旧,不知何解。

    -------------------------

    回 4楼dongshan8的帖子
    依然是

    -------------------------

    回 7楼dongshan8的帖子
    您好,没有修改过,完完全全是小白一名。

    -------------------------

    回 12楼dongshan8的帖子
    您好,非常感谢,已经解决。我在选择安装系统的时候,习惯性选了第一个,没认真看,这个不是centos,第二个才是。
    如图:
    2016-12-07 05:39:10
    赞同 展开评论
  • 阿里云论坛版主,QQ 1978638808
    https://bbs.aliyun.com/read/274619.html       类似的问题已经有解决方案
    2016-12-06 08:52:14
    赞同 展开评论
问答地址: