1

I set up a SFTP Chroot Jail succesfully, but would like to give my users access over SSH, in addition to SFTP. If I attempt to SSH in with the testuser, after providing the password, putty closes. Using Python's paramiko module to perform an SSH connection, I receive this message:

This service allows sftp connections only.

The usual culprit to this problem appears to occur when the sysadmin leaves ForceCommand internal-sftp uncommented in the /etc/ssh/sshd_config file. However, my /etc/ssh/sshd_config looks like this, with ForceCommand internal-sftp commented out:

Match group jailedusers
    ChrootDirectory /jailed/%u
    #ForceCommand internal-sftp
    AllowTcpForwarding no

When I created my testuser, I initially set his bash to /bin/false, but have changed it to /bin/bash. If I cat /etc/passwd and search for my testuser, I see:

testuser:x:573:502::/jailed/testuser:/bin/bash

What other reason could be preventing me from SSHing with this user?

  • What do you see in syslog? Are you getting any denies in /var/log/audit/audit.log or dmesg? Did you try setting the sshd_config loglevel to debug and restarting sshd? Did you remove testuser from the jailedusers group, given that it wont be able to use bash in a chroot. – Aaron Jan 8 '16 at 4:58
  • You don't have bash in chroot. – Jakuje Jan 8 '16 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.