LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   su[ing] retaining the environment. (https://www.linuxquestions.org/questions/linux-newbie-8/su%5Bing%5D-retaining-the-environment-850396/)

stf92 12-15-2010 08:40 AM

su[ing] retaining the environment.
 
Hi:
As I am doing some maintenance work these days, I am logging in as root, on tty1. On tty6 I log in as non-root user foo_1 and run the GUI. On this GUI, I have Konsole. Running it, it opens a terminal for me, and I find myself as foo_1 and having inherited root's environment. What I want to do from this terminal in which I'm foo_1, is to su to root retaining the environment. But how to do it?

If I made myself clear, this environment I want, is that which I had when I logged into tty1 after turning on the machine. Of course, if Konsole would log me in directly as root and with the initial environment, I would be saving myself a step, namely, su. Thank you for reading.

EDIT: the desktop environment is Xfce4 and it offers Main Menu>Terminal and Konsole. Konsole seems to be a kind of terminal for root, although it doesn't su me to root.

ozanbaba 12-15-2010 08:47 AM

I think you are looking for this:
Code:

su -

stf92 12-15-2010 10:10 AM

I think you're right. Shame on me. It's one of the first things the man page says. Thanks.

ozanbaba 12-15-2010 10:21 AM

Let me drop some comments for future searchers.

"su -" opens up a login shell. It has same env as if you logged in from the console. For more detailed information check out shell man pages for login shell.


All times are GMT -5. The time now is 06:57 PM.