I have a small elif script that has 4 options. I will need to make a user that has permissions to run just that script on login and when it finishes with the script to log him out.
I am trying to do it trough /etc/passwd like this: user:x:1003:1003::/home/user:script.sh
When already connected with root and then "su" to user, it executes the script. The issue is that the user cant connect trough putty and execute the script, which is the goal of what i am trying to do.
Any advise is welcome and appreciated.
Cheers,
Try giving the full path to
script.shinpasswd. Even if this file is in the $PATH when yousuto the user, it isn't necessarily in the $PATH in an SSH session. The SSH session might provide an environment that is different in other ways, too.