custom login script for *shared account* (using SSH)
There is a shared account (not by choice, and not my choice). I ssh into it, along with many other users. Some users share the password, others use the public key method (each user has their own pair of keys).
I have a number of shell preferences that I would not want to affect other users. So changing .bashrc, .profile, .kshrc, etc types of scripts in the shared account is not practical, because changing them would affect everyone. What would be a practical way to have a script execute automatically, only when logging in by way of my private (id_rsa) key? Could I perhaps change the .profile in a way that it runs some commands only if my public key was used to authenticate the login?
I've considered this:
ssh sharedUser@host 'bash -s' < my_local_script.sh
but it simply terminates when done. I want it to hand the shell over to me.
Also, when many users are logged in, the "w" command shows several users with the same shared username. Is there anything I can do to make my own session distinct? E.g. instead of showing username "sharedUser", I want it to show "gnuweenie via sharedUser", or something.
Last edited by gnuweenie; 03-03-2011 at 02:15 PM.