chroot jail : problems logging in: a suggestion
I was having no luck logging into an account set up with a chroot jail on my server. This was an older web site before I set up chroot jail. No matter what I did: SCP, SFTP, SFTP with SCP fallback -- I could not log in.
SCP kept saying:
Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).
SFTP kept saying:
Cannot initialize SFTP protocol. Is the host running a SFTP server? Connection has been unexpectedly closed. Server sent command exit status 1.
/var/log/messages kept showing a session opening and closing with no useful error messages.
Finally a clue in /var/log/secure:
chroot dir writable by group: /var/www/html/name_of_web_dir
Yep. For chroot, the top level directory cannot be group writeable. chmod 755 name_of_webdir solved my problem ... 1 hour later!!
Hope this helps someone.
SCP kept saying:
Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).
SFTP kept saying:
Cannot initialize SFTP protocol. Is the host running a SFTP server? Connection has been unexpectedly closed. Server sent command exit status 1.
/var/log/messages kept showing a session opening and closing with no useful error messages.
Finally a clue in /var/log/secure:
chroot dir writable by group: /var/www/html/name_of_web_dir
Yep. For chroot, the top level directory cannot be group writeable. chmod 755 name_of_webdir solved my problem ... 1 hour later!!
Hope this helps someone.