Mechanisms to be root after ssh login (w/o using sudo)

0

Our servers are set-up in a way, that after ssh'ing to them using our userid ssh my_user@server(I am immediately greeted with [root@server ~]# The command id confirms that, indeed, I am root. However, I do end up in my own home directory /home/my_user.
I've tried to find clues as how this is set up, but neither sshd_config, /etc/passwd or /etc/group shows anything out of the ordinary
Any idea how this is achieved ?

I do think this is not really a secure set up and I plan to do things different in the near future (we are about to upgrade our OSes), but I still like to understand

oneindelijk

Posted 2020-02-26T15:37:13.677

Reputation: 207

3I suppose someone set this up. We can guess; they just know. Did you ask them first? What did they say? – Kamil Maciorowski – 2020-02-26T15:48:10.203

2What uid does the my_user account have? (Check id my_user and getent passwd my_user.) – user1686 – 2020-02-26T15:58:53.100

Try looking for it in the shell startup files, /etc/profile and the ones under /etc/profile.d or /etc/bashrc or similar if it exists, also in your home, ~/.bash_profile and ~/.bashrc. This is probably implemented with a call to sudo, look for that... Also check that your user can sudo without a password, which would probably be needed... Your normal home directory is kept by preserving the $HOME environment variable, normally after login that's what is used (and not necessarily the entry from /etc/passwd anymore.) – filbranden – 2020-02-26T17:08:25.547

No answers