Bug 2036 - Add %g user group name parameter for ChrootDirectory
Summary: Add %g user group name parameter for ChrootDirectory
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 6.0p1
Hardware: ix86 Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-19 05:28 AEST by Sue Spence
Modified: 2012-08-19 05:28 AEST (History)
0 users

See Also:


Attachments
Patch which implements the functionality described above. (961 bytes, application/octet-stream)
2012-08-19 05:28 AEST, Sue Spence
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sue Spence 2012-08-19 05:28:09 AEST
Created attachment 2182 [details]
Patch which implements the functionality described above.

When chrooting users it can be useful to be able to use a user's group name as a parameter when constructing the chroot directory path for a user. The code already supports parameter expansion for the user name (%u) and home directory (%h).

So, this can be implemented by a fairly simple extension of the existing code. I have attached a patch which adds the parameter %g which expands to the user's group name if used in a ChrootDirectory configuration line in sshd_config. E.g.  ChrootDirectory  /opt/domains/%g  If user foo with group bar connects via ssh then they will be chroot'd to /opt/domains/bar

TODO: update the man page