0

We have a server 'x'. We want a setup in which a user 'test' should scp a file 'f' to server 'x' then should login to the server(using ssh) and run a script 'test.sh' which does some operations on file 'f'. We dont want to give shell access to user 'test' . Is this possible?

I tried modifying /etc/passwd file on the server. Instead of /bin/bash, i tried giving the script name test.sh. This way when 'test' logs in, it executes the script and then connection gets closed. But with this approach i am not sure how can i make the user to scp the file 'f' to server? 'f' is a text file.

  • you can configure the script as the login shell for the user – hek2mgl Oct 18 '13 at 08:50
  • user "test" might put the file "f" in his public_html with a well known address. Then, the test.sh can "download" the file, check the permission, md5sum for security, and execute it. – Alessandro Russo Oct 18 '13 at 09:21
  • one way would be using ssh key authentication with custom command restrictions: one key would be allowed to run only test.sh, another would be allowed to `scp` – janos Oct 18 '13 at 22:01
  • Thanks. Can you please explain or point me to some thread on how can we do 'ssh key authentication with custom command restrictions'? Sorry,i am a newbie, help is appreciated.. – user2541426 Oct 23 '13 at 07:13

0 Answers0