SFTP 시간 초과이지만 SSH는 정상적으로 작동합니다.

자레드 마이 어링

내 서버 설정에 sftp (또는 scp)를 할 수 없지만 ssh는 잘 할 수 있습니다. 둘 다 키 인증을 사용하고 있습니다.

내가 sftp를 할 때 그것은 영원히 멈추고 sftp 프롬프트를주지 않습니다.

다음은 내 자세한 sftp 실행의 출력입니다.

$ sftp -vvv dev@server
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to server [ipaddress] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/vagrant/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/vagrant/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/vagrant/.ssh/id_rsa-cert type -1
debug1: identity file /home/vagrant/.ssh/id_dsa type -1
debug1: identity file /home/vagrant/.ssh/id_dsa-cert type -1
debug1: identity file /home/vagrant/.ssh/id_ecdsa type -1
debug1: identity file /home/vagrant/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.4
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "server" from file "/home/vagrant/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/vagrant/.ssh/known_hosts:42
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256
,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffi
e-hellman-group1-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384
,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-m
d5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-m
d5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffi
e-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-m
d5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-m
d5-96
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA fd:e1:ab:e1:03:4d:1e:80:ba:76:4e:4a:8a:57:e1:d6
debug3: load_hostkeys: loading entries for host "server" from file "/home/vagrant/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/vagrant/.ssh/known_hosts:42
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "ipaddress" from file "/home/vagrant/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/vagrant/.ssh/known_hosts:43
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'server' is known and matches the ECDSA host key.
debug1: Found key in /home/vagrant/.ssh/known_hosts:42
debug1: ssh_ecdsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/vagrant/.ssh/id_rsa (0xb7954db8)
debug2: key: /home/vagrant/.ssh/id_dsa ((nil))
debug2: key: /home/vagrant/.ssh/id_ecdsa ((nil))
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/vagrant/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp c6:c6:df:44:89:bf:1e:da:fe:89:d7:3c:36:69:ef:94
debug3: sign_and_send_pubkey: RSA c6:c6:df:44:89:bf:1e:da:fe:89:d7:3c:36:69:ef:94
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to server ([ipaddress]:22).
debug2: fd 4 setting O_NONBLOCK
debug3: fd 5 is O_NONBLOCK
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Remote: Forced command.
debug1: Remote: Forced command.
debug2: callback start
debug2: client_session2_setup: id 0
debug2: fd 3 setting TCP_NODELAY
debug1: Sending environment.
debug3: Ignored env TMUX_GIT_LASTREPO
debug3: Ignored env TERM
debug3: Ignored env SHELL
debug3: Ignored env SSH_CLIENT
debug3: Ignored env SSH_TTY
debug1: Sending env LC_ALL = en_US
debug2: channel 0: request env confirm 0
debug3: Ignored env USER
debug3: Ignored env LS_COLORS
debug3: Ignored env TODOTXT_DEFAULT_ACTION
debug3: Ignored env TMUX
debug3: Ignored env PATH
debug3: Ignored env MAIL
debug3: Ignored env PWD
debug3: Ignored env EDITOR
debug1: Sending env LANG = en_US
debug2: channel 0: request env confirm 0
debug3: Ignored env NODE_PATH
debug3: Ignored env TMUX_PANE
debug3: Ignored env SHLVL
debug3: Ignored env HOME
debug3: Ignored env GOROOT
debug3: Ignored env LOGNAME
debug3: Ignored env SSH_CONNECTION
debug3: Ignored env LESSOPEN
debug3: Ignored env GOPATH
debug3: Ignored env LESSCLOSE
debug3: Ignored env _
debug1: Sending subsystem: sftp
debug2: channel 0: request subsystem confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: subsystem request accepted on channel 0
debug2: client_check_window_change: changed
debug2: client_check_window_change: changed
debug2: client_check_window_change: changed
^Cdebug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i0/0 o0/0 fd 4/5 cc -1)

debug1: fd 0 clearing O_NONBLOCK
debug3: fd 1 is not O_NONBLOCK
debug1: Killed by signal 15.

여기에 sshd_config가 있습니다.

Port 22
Port 2222

AcceptEnv LANG LC_*
ChallengeResponseAuthentication no
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostbasedAuthentication no
IgnoreRhosts yes
KeyRegenerationInterval 3600
LogLevel INFO
LoginGraceTime 120
PermitEmptyPasswords no
PermitRootLogin no
PrintLastLog yes
PrintMotd no
Protocol 2
PubkeyAuthentication yes
RSAAuthentication yes
RhostsRSAAuthentication no
ServerKeyBits 768
StrictModes yes
Subsystem sftp /usr/lib/openssh/sftp-server
SyslogFacility AUTH
TCPKeepAlive yes
UsePAM yes
UsePrivilegeSeparation yes
X11DisplayOffset 10
X11Forwarding yes

서브 시스템이 전송되고 있지만 여전히 프롬프트가 표시되지 않습니다. 아이디어가 있습니까?

편집하다


내가 추가하면 모든 것이 잘 작동합니다.

Forcecommand inetrnal-sftp

그러나 분명히 이것은 나를 위해 일반 ssh를 깨뜨립니다.


자레드 마이 어링

많은 파고 끝에 우리는 문제가 우리의 ssh 키가 우리 서버에 추가되는 방식이라는 것을 발견했습니다.

키 자체에서 명령이 설정되어 sftp 프롬프트로 이동하지 못하도록했습니다. 도움을 주신 모든 분들께 감사드립니다!

command=/bin/bash ssh-rsa ...

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

SFTP 시간 초과이지만 SSH는 정상적으로 작동합니다.

분류에서Dev

Lightsail 도메인이 시간 초과를 요청하지만 IP는 정상적으로 작동합니다.

분류에서Dev

SSH 연결이 외부 적으로 시간 초과되었지만 내부적으로 작동합니다.

분류에서Dev

ssh 로그인은 작동하지만 sftp는 작동하지 않습니다.

분류에서Dev

tomcat은 html에서 404 오류를 표시하지만 jsp는 정상적으로 작동합니다.

분류에서Dev

Jersey Client는 읽기 시간 초과를 제공하지만 Apache HTTP Client는 정상적으로 연결됩니다.

분류에서Dev

ipv6을 통해 연결하는 동안 SSH 시간이 초과되지만 ipv4에서 작동합니다.

분류에서Dev

대시는 Ubuntu 13.04에서 정상적으로 작동하지 않습니다.

분류에서Dev

마지막 중괄호 →}가 녹색 대신 빨간색으로 바뀌지 만 스크립트는 정상적으로 작동합니다 (Google App Script).

분류에서Dev

Mac OS에서 PyQt4 확인란이 표시되지 않지만 (클릭 가능) Windows에서는 정상적으로 작동합니다.

분류에서Dev

gactions로 작업 패키지 업데이트는 항상 요청 시간 초과를 반환합니다.

분류에서Dev

Teamcity는 서비스로 실행될 때 시작되지 않지만 실제 명령은 정상적으로 작동합니다.

분류에서Dev

SSH 콘솔 로그인이 작동하지만 SFTP가 작동하지 않는 이유는 무엇입니까?

분류에서Dev

Ping 호스트 이름은 작동하지만 ssh는 로컬 시스템에 적합하지 않습니다.

분류에서Dev

CSS는 실시간으로 업데이트되지 않지만 스테이징을 위해 작동합니다.

분류에서Dev

시간 초과가있는 For 루프가 작동하지 않는 것 같고 이상한 숫자를 제공합니다.

분류에서Dev

새 플래시 드라이브에 sdb1이 없지만 정상적으로 작동합니다.

분류에서Dev

봄 부팅 REST는 : 정렬 방향은 무시하지만, 정렬 일반적으로 작동합니다

분류에서Dev

SSH는 작동하지만 SFTP는 작동하지 않습니다.

분류에서Dev

SSH는 작동하지만 SFTP는 작동하지 않습니다.

분류에서Dev

SFTP는 터미널에서 제대로 작동하지만 sftp URL로 이동할 수 없습니다.

분류에서Dev

날짜의 차이를 계산하고 시간의 분과 초의 차이를 얻습니다-이상적으로는 js, 그렇지 않으면 moment.js

분류에서Dev

Centos7 http가 정상적으로 시작되지 않습니다. httpd는 작동하지만 systemctl은 httpd를 시작하지 않습니다.

분류에서Dev

phantomjs는 페이지를로드 할 때 항상 시간 초과됩니다.

분류에서Dev

유형 인수 간섭은 작동하지 않지만 명시 적 유형 인수는 작동합니다.

분류에서Dev

Android는 시간과 현재 시간을 지속적으로 비교합니다.

분류에서Dev

Paramiko는 SSH 서버의 로그인 시간 초과를 확인합니다.

분류에서Dev

PDO 준비 문을 사용하는 로그인 페이지가 작동하지 않지만 그렇지 않으면 정상적으로 작동합니다.

분류에서Dev

비정상적으로 작동하는 페이지 간의 PHP 세션

Related 관련 기사

  1. 1

    SFTP 시간 초과이지만 SSH는 정상적으로 작동합니다.

  2. 2

    Lightsail 도메인이 시간 초과를 요청하지만 IP는 정상적으로 작동합니다.

  3. 3

    SSH 연결이 외부 적으로 시간 초과되었지만 내부적으로 작동합니다.

  4. 4

    ssh 로그인은 작동하지만 sftp는 작동하지 않습니다.

  5. 5

    tomcat은 html에서 404 오류를 표시하지만 jsp는 정상적으로 작동합니다.

  6. 6

    Jersey Client는 읽기 시간 초과를 제공하지만 Apache HTTP Client는 정상적으로 연결됩니다.

  7. 7

    ipv6을 통해 연결하는 동안 SSH 시간이 초과되지만 ipv4에서 작동합니다.

  8. 8

    대시는 Ubuntu 13.04에서 정상적으로 작동하지 않습니다.

  9. 9

    마지막 중괄호 →}가 녹색 대신 빨간색으로 바뀌지 만 스크립트는 정상적으로 작동합니다 (Google App Script).

  10. 10

    Mac OS에서 PyQt4 확인란이 표시되지 않지만 (클릭 가능) Windows에서는 정상적으로 작동합니다.

  11. 11

    gactions로 작업 패키지 업데이트는 항상 요청 시간 초과를 반환합니다.

  12. 12

    Teamcity는 서비스로 실행될 때 시작되지 않지만 실제 명령은 정상적으로 작동합니다.

  13. 13

    SSH 콘솔 로그인이 작동하지만 SFTP가 작동하지 않는 이유는 무엇입니까?

  14. 14

    Ping 호스트 이름은 작동하지만 ssh는 로컬 시스템에 적합하지 않습니다.

  15. 15

    CSS는 실시간으로 업데이트되지 않지만 스테이징을 위해 작동합니다.

  16. 16

    시간 초과가있는 For 루프가 작동하지 않는 것 같고 이상한 숫자를 제공합니다.

  17. 17

    새 플래시 드라이브에 sdb1이 없지만 정상적으로 작동합니다.

  18. 18

    봄 부팅 REST는 : 정렬 방향은 무시하지만, 정렬 일반적으로 작동합니다

  19. 19

    SSH는 작동하지만 SFTP는 작동하지 않습니다.

  20. 20

    SSH는 작동하지만 SFTP는 작동하지 않습니다.

  21. 21

    SFTP는 터미널에서 제대로 작동하지만 sftp URL로 이동할 수 없습니다.

  22. 22

    날짜의 차이를 계산하고 시간의 분과 초의 차이를 얻습니다-이상적으로는 js, 그렇지 않으면 moment.js

  23. 23

    Centos7 http가 정상적으로 시작되지 않습니다. httpd는 작동하지만 systemctl은 httpd를 시작하지 않습니다.

  24. 24

    phantomjs는 페이지를로드 할 때 항상 시간 초과됩니다.

  25. 25

    유형 인수 간섭은 작동하지 않지만 명시 적 유형 인수는 작동합니다.

  26. 26

    Android는 시간과 현재 시간을 지속적으로 비교합니다.

  27. 27

    Paramiko는 SSH 서버의 로그인 시간 초과를 확인합니다.

  28. 28

    PDO 준비 문을 사용하는 로그인 페이지가 작동하지 않지만 그렇지 않으면 정상적으로 작동합니다.

  29. 29

    비정상적으로 작동하는 페이지 간의 PHP 세션

뜨겁다태그

보관