santanudas
Technical User
Hi all,
I have a really tricky requirement. I need to create a special-purpose user account, by giving it a shell which only allows the ‘sftp-server’ and a set of commands, namely ‘passwd’ ‘ls’ and ‘cd’ (ls & cd within the ~user directory only).
Initially, I replaced '/bin/bash' by '/usr/libexec/openssh/sftp-server' in
‘/etc/passwd’ for that particular user to run sftp-server ONLY. The trick is working but I want the user to change his/her password time to time and issue ‘ls’ and ‘cd’ to list ONLY the files inside his/her home directory. Now, as I changed the ‘/bin/bash’ part, if you do, say 'ssh $user@abc.com' it's asking for the password and after the password it's not doing ANY thing (as expected). My second question is: In stead of not doing any thing how can I print a massage like: "You are not allowed to use a shell" or something like that. Is it possible?
Thanks in advace!!!!
I have a really tricky requirement. I need to create a special-purpose user account, by giving it a shell which only allows the ‘sftp-server’ and a set of commands, namely ‘passwd’ ‘ls’ and ‘cd’ (ls & cd within the ~user directory only).
Initially, I replaced '/bin/bash' by '/usr/libexec/openssh/sftp-server' in
‘/etc/passwd’ for that particular user to run sftp-server ONLY. The trick is working but I want the user to change his/her password time to time and issue ‘ls’ and ‘cd’ to list ONLY the files inside his/her home directory. Now, as I changed the ‘/bin/bash’ part, if you do, say 'ssh $user@abc.com' it's asking for the password and after the password it's not doing ANY thing (as expected). My second question is: In stead of not doing any thing how can I print a massage like: "You are not allowed to use a shell" or something like that. Is it possible?
Thanks in advace!!!!