On Friday 18 March 2005 00:53, David Truchan-contr wrote:
Thanks for the feedback. traping ^c doesn't prevent non-interactive logins from still issuing other commands. Something like ssh host "cat /etc/passwd" is still possible.
There is quite some usefull info in bash's manual page. You can read all about this in the section "Invocation". It might take some time to understand the possibilities and to experiment a bit. Here is something I tried out: Create a file /etc/bash.bashrc.local with the following content: if shopt -q login_shell; then echo "interactive" else echo "non-interactive" echo "This is not allowed. Terminating..." exit fi An interactive shell, invoked with e.g. 'ssh user@host', is allowed. A non-interactive shell, invoked with e.g. 'ssh user@host ls', is not allowed. To only use this for a particular group of users, you would have to create a new group, make those users a member of that group, and put above code between a check for membership. Cheers, Leen