Operating System - Linux
1826187 Members
2658 Online
109691 Solutions
New Discussion

Re: su from root to user on remote server with working display.

 
SOLVED
Go to solution
Joakim Brosten
Frequent Advisor

su from root to user on remote server with working display.

God morning,

I need to test some of my users graphical applications/environment running as them on their Linux boxes from time to time. The problem is that I don't know the users password. The way I would like to solve this is to login as root, (that password I know), on their Linux box using "ssh -X root@linux_server" then "su - user_name" but by doing that, I loose the DISPLAY variable. If I try to export the same variable that is set for the ssh as root session, ssh won't allow the traffic.
Any good idéas?

Thanks in advance, /Joakim
4 REPLIES 4
Stuart Browne
Honored Contributor
Solution

Re: su from root to user on remote server with working display.

If you have this level of access, why not set up a shared key, so an account using this specific key (kept nice and secure by you) can ssh in as the user.. ?
One long-haired git at your service...
Joakim Brosten
Frequent Advisor

Re: su from root to user on remote server with working display.

Hi Stuart,

thank you for replying. This seems to be a good solution. I tried to "man ssh" to find more info but didn't succeeded. Could you please point out the direction for more knowledge?

Thank you, /Jocke
Ivan Ferreira
Honored Contributor

Re: su from root to user on remote server with working display.

Please see:

http://blog.taragana.com/index.php/archive/linux-how-to-how-to-ssh-without-password-authentication/

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Joakim Brosten
Frequent Advisor

Re: su from root to user on remote server with working display.

Stuart, Ivan,

Thank you for help. We have a NIS environment which makes it a little more complicated but I've gone through the "trial and error" state now and think I know how to solve the matter.

Thanks again, points to be awarded.

/Joakim