PDA

View Full Version : Limiting User Access in SSH?


Belldandy
March 15th, 2005, 12:32 AM
Hello everyone,

Oh my server I have three accounts: myself and two other co-workers. I want to limit the SSH access of my coworkers to only their home directories and /var/www/userswebsitehere

How can I do this? And once i do this, is there a way to place a "shortcut" in the users home directory that will route them to the /var/www/userwebsitehere folder? For example, if they are in their home directory, they will see a "web" folder, then they type in "cd web" via their terminal, it will link them to /var/www/userswebsitehere/ instead of /home/username/web.

Any ideas?

Thank you!

deuce868
March 15th, 2005, 09:47 AM
You want to set up a chroot jail for them.

Start here:
http://www.google.com/search?q=debian+chroot+jail+ssh+user&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox&rls=org.mozilla:en-US:unofficial

alastair
March 15th, 2005, 07:54 PM
I think chroot jail might be overkill perhaps.

I think this is just a question of good unix permissions. Basically, who cares if they can "cd /" as long as they cannot read or change things they have no permission for?

For the "web" folder - same thing. Give them (as a group perhaps) the right permissions for this directory access and you are set (make a symlink on their desktop if you want). There's no need to complicate matters.

haselden
March 16th, 2005, 01:23 AM
Try the AllowUsers directive in your sshd_config file.

A 'man sshd_config' will give you more info on it