How can I do su from one user to another in same server without any password prompt for example su - xyz while in ABC user profile. Note:- I can't do sudo only su is required.
1 Answers
AFAIK, it's not possible for compelling security reasons (unless you have sudo privileges that allow it, which is a risk in and of itself).
If someone gains access to one account, that account's data is compromised. If that account has sudo permissions, every account is compromised. If the account has sudo permissions, your desired situation becomes possible. Let's say account
a
has been compromised (it's password was somehow magically hacked through a live disk for example).a
has sudo privileges. Ifa
runssudo su b
and enters the password correctly, they have access to accountb
without any password but their own. This is obviously undesirable, and is an argument for ensuringsudo
is configured safely.Here's a new scenario: user
x
doesn't have sudo permissions, but can runsu y
withouty
's password.y
has sudo permissions, and thinking "no one will ever guess this," set his password to1234
.x
runssu y
and then runssudo su
and enters1234
.x
would gain root privileges, despite the admin deliberately (maybe the admin knowsx
would trust Internet comments that are a threat to security - though such an admin would be smart enough to make sure passwords weren't1234
, this is a hypothetical situation) not giving them tox
. Hi security breach, my name is gurk! (That's the sound I imagine an [incapable of existing] sentient AI would make upon being attacked by a [also incapable of existing] sentient virus).
My answer can be summarized as:
No, it's impossible (on a well-setup computer. Someone who doesn't know what they're doing might set it up so you could, but that's Bad with a capital B). If you could do it, so could anyone else, and that's a huge security threat.
I apologize if this isn't what you were hoping for.

- 35
-
Both are my account used for different purposes but I need to access each other through them for script use – Nitesh Prakash Mar 12 '17 at 07:32
sudo
is not installed then it's not any normal Ubuntu installation – Zanna Mar 12 '17 at 21:37