I want to make ForceCommand internal-sftp and ChrootDirectory /jail the default for all users accessing a server via SSH. Only users in a certain group are allowed to escape this.

How can I exclude a certain group from ForceCommand internal-sftp in a Match block?

It's possible to reset ChrootDirectory by assigning a none value.

Matching the group and settingForceCommand none doesn't work (probably because there is no "none" program), ForceCommand bash works for shell access, but SFTP will no longer work.

link|improve this question

feedback

1 Answer

up vote 1 down vote accepted

this works for me with OpenSSH 5.1:

set a restricted default for everyone, but let the staff group have the (unrestricted) defaults.

Match Group *,!staff
        ChrootDirectory /home/ftp
        ForceCommand internal-sftp
link|improve this answer
Very nice. Works just as well as "resetting" defaults in case I add new users. Thank you! – Daniel Beck Oct 8 '11 at 10:07
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.