I'm curious if there is a way to enable one user to login (via su) into another user, without needing to know that users password. For instance, if I'm logged in as user1, I would like to give user2 permission to log in to me, but for whatever reason it's infeasible for him to know the password. Let's say the reason is because I use a random string of 20 uppercase/lowercase/numbers. For clarification, I don't just want access to that users files, I want to be fully logged in as that user.
Via ssh, this is easy, I grab his public key, stick it in .ssh/
If user1 happens to be root, it's easy, I just give NOPASSWD access in sudoers.
Perhaps the solution is: use ssh to do it. But, that's inelegant, isn't it? And it seems very inelegant if this is only possible for root, but no one less important than root.
Extra points: Can this be set up without root being the one who sets it up? Again, the ssh solution solves this problem, but inelegantly.