I want to login as a different user in Gnome and not to run a single program only, but I don't know the users password, I don't want to know it and I don't want to change it, but I'm sudoer.
Is there any way to do so?
The best thing I could think, was to change the user's password but to keep the old shadow file. But this seems to me very ugly and also uncomfortable. I'm also not sure if it's a good idea to change the shadow file on a running machine (but I suppose so, otherwise vipw -s
would kind of useless).
Is there an alternative?
The reason I want to achieve this, is that I'd like to test things or to configure programs for users who aren't able to do on their own. Yeah of course I could do everything on the shell als root or as the specific user (and acutally this is what I'm doing until now), but there are things that you definitly don't want to do on the shell. Did any of you ever try to change the position of the gnome-panel on the shell instead of just selecting "bottom"? :)
I don't think gksudo, sudo or su would help me. I want to have the whole gnome session.
Become root
As root, sudo to the other user
If you want to run X applications, take a look at xhost
I'm not sure if this is the best way, but here's an option I've just tested, and works on natty although I don't have an extra user set up so I'm not totally sure:
(in another terminal)
Then Ctrl-Alt-F8 and you should find the new session. It might not be exactly same as logging in normally, but I'm pretty sure it'll let you rearrange panels as much as you like.
Use Ctrl-Alt-F7 to return to your original session. If those F-keys don't work for you, try others.
OLD-SCHOOL METHOD
Create a ghost user, with the same UID:
target: user1 (change to suit)
add your ghost
NOTE: You can delete, with 'sudo userdel ghost1', but NOT when either account is logged in. Failsafe method: delete the new line in '/etc/passwd' file.