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
ahas been compromised (it's password was somehow magically hacked through a live disk for example).ahas sudo privileges. Ifarunssudo su band enters the password correctly, they have access to accountbwithout any password but their own. This is obviously undesirable, and is an argument for ensuringsudois configured safely.Here's a new scenario: user
xdoesn't have sudo permissions, but can runsu ywithouty's password.yhas sudo permissions, and thinking "no one will ever guess this," set his password to1234.xrunssu yand then runssudo suand enters1234.xwould gain root privileges, despite the admin deliberately (maybe the admin knowsxwould 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
sudois not installed then it's not any normal Ubuntu installation – Zanna Mar 12 '17 at 21:37