sftp connection closed after correct password
I would set LogLevel VERBOSE
in /etc/ssh/sshd_config
then restart sshd and check /var/log/auth.log
to get more details.
Related videos on Youtube
codebox
Updated on September 18, 2022Comments
-
codebox almost 2 years
I'm running an sftp server on port 10022 using openssh-server on debian, hosted on EC2/AWS. I have configured password-based authentication for a single user, but the server connection is closed immediately after I submit the correct password. Here is the output from the sftp client:
steve@localhost's password: debug2: we sent a password packet, wait for reply debug1: Authentication succeeded (password). Authenticated to localhost ([127.0.0.1]:10022). debug2: fd 4 setting O_NONBLOCK debug1: channel 0: new [client-session] debug2: channel 0: send open debug1: Requesting [email protected] debug1: Entering interactive session. debug1: pledge: network debug1: channel 0: free: client-session, nchannels 1 debug1: fd 0 clearing O_NONBLOCK Connection to localhost closed by remote host. Transferred: sent 1972, received 1644 bytes, in 0.0 seconds Bytes per second: sent 1281358.2, received 1068231.7 debug1: Exit status -1 Couldn't read packet: Connection reset by peer
I have the server running inside a docker container, the really weird thing is that if I run the docker container locally on my Mac I can connect just fine, but when I run it on the AWS server I get the problem above. The above output was produced by running the sftp client on the AWS server (trying to connect to localhost) so I don't think this is anything to do with network access to AWS
-
codebox over 6 yearsThanks, I already have this set but no output is produced in any log file - auth.log doesn't exist
-
Fabian over 6 yearsIn
/etc/ssh/sshd_config
you can setSyslogFacility AUTH
. After restart of sshd auth.log should be available. -
codebox over 6 yearsOk, I managed to get hold of logging information by having docker start sshd in debug mode - this told me that the permissions for the chroot jail were incorrect. Despite me having run chown root:root command in the Dockerfile the owner/group were set to '500'. Manually changing these to root fixed the problem. Thanks for your help!
-
Geradlus_RU almost 4 yearsThank you a lot! Your suggest change log level was brilliant! I've tried to set
ChrootDirectory
to directory which is located deep into other user's home. This is not work, OpenSSH requires that all chrooted directory components have correct ownership and permissions (root.root 755)