I'm trying to make a user that can access my server through SSH and allow it to have a shell, limited to using only, say screen and irssi. And it shouldn't it be able to see other directories except it's home folder and sub directories within it. And the usage of memory/cpu should be limited to a certain amount. How should I go about implementing it on a Centos 6.1 server?
|
|
Use use the "command" directive from the ssh authorized_keys file, and/or specify that a restricted shell (/bin/rsh) should be used for the user. The o'reilly ssh book is a key reference guide (no pun intended); or google for "restricted shell", "ssh authorization file". Some references:
Anyway, this is sort of a meta-answer pointing to other answers, but the key really is using the authorization file and specifying the command(s) that are allowed to be executed on the remote host, and/or using the restricted shell to limit access to the remote box. |
|||
|
|
|
First of all check please ChrootUser in /etc/ssh/sshd_config it should jail Your users (there is specific version of OpenSSH needed for that). Second method is to install some jail software. I'm using jailkit on some servers and it's giving me all what I need. Third possibility is probably grsec if it's still in development. :-) |
|||
|
|
