2
At the company where I work we have a certain shared accounts that anyone can use over SSH to perform specific tasks. At this point, we have too many users and each of them has their own usability perks such as shell aliases etc.
What I am trying to do is allow users to have different shell settings through the ~/.bash_profile
depending on who actually logged in. For example, when Jonathan logs in, I want shell to additionally execute ~/.Jonathan_profile
, and for Bob, I want the shell to source ~/.Bob
profile.
I am not sure, however, if there is a way to tell the account name on the remote machine of a user logged in using SSH.
Any hints are greatly appreciated.
if there is a way to tell, I would call that a security flaw in the ssh client or protocol. you should not be able to do as you suggest. – Frank Thomas – 2013-10-03T12:59:23.140
@FrankThomas: That's what I though, too. Any ideas as to possible ways to achieve what I want? – None – 2013-10-03T13:02:27.687
2Don't use shared accounts? other than that, you can run some kind of script on login to solicit the info and load a new shell, or try to use some other intermediary (shared database, hostname mapping, etc) but that will require you to roll-your-own solution. – Frank Thomas – 2013-10-03T13:11:39.303
The most used solution for this is to give each user their own account (and thus their own profile with their own aliases etc etc. Then give them the right to do specific tasks from that account. – Hennes – 2013-10-03T14:22:44.580
Consider requiring use of sudosh to gain access to user accounts other than one's own. – Daniel Beck – 2013-10-04T08:16:39.300