Is there a way to allow a user to execute commands via ssh, for example:
“ssh user@server ls”, but disallow the same user to login on this server with “ssh user@server” ?
Google “ssh restrict to single command”.
First hit covers using the command option in authorized_keys.
you can use the option command your /home/user/.ssh/authorized_keys .
for example :
command=”cd /some_where; other command , ssh-rsa key …..”
I made my search on google way to complicated for nothing…. :(
Thanks John and Seb! authorized_keys will do the job.
CentOS mailing list CentOS@CentOS.org https://lists.CentOS.org/mailman/listinfo/CentOS
Only way to learn is from your mistakes ;-) .
If you need interactive login for f.e. sftp you should have a look at rssh. It allows only scp, sftp, cvs, rdist and rsync. It’s probably not too hard to patch in other commands if you would need those.
A little netiquette: Please don’t top post, it makes the flow of the conversation unclear. A little trimming of the text you reply to is also appreciated. Especially signatures do not provide any context so they should always be removed. Thanks.