LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-15-2010, 09:40 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,485

Rep: Reputation: 51
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.

Last edited by stf92; 12-15-2010 at 09:44 AM.
 
Old 12-15-2010, 09:47 AM   #2
ozanbaba
Member
 
Registered: May 2003
Location: Tengiz
Distribution: Slackware64 14.1
Posts: 672

Rep: Reputation: 94
I think you are looking for this:
Code:
su -
 
Old 12-15-2010, 11:10 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,485

Original Poster
Rep: Reputation: 51
I think you're right. Shame on me. It's one of the first things the man page says. Thanks.
 
Old 12-15-2010, 11:21 AM   #4
ozanbaba
Member
 
Registered: May 2003
Location: Tengiz
Distribution: Slackware64 14.1
Posts: 672

Rep: Reputation: 94
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Retaining format Labman Linux - Newbie 5 05-04-2008 06:48 PM
SLED 10 - retaining old settings? chucker8 Linux - Desktop 0 09-18-2006 12:32 PM
Retaining settings on re-install? biased99 Red Hat 1 01-01-2005 06:47 PM
retaining environment variables using ssh lightningdan Linux - Software 3 12-15-2004 06:43 PM
retaining /dev permission kaise_sose Linux - Newbie 2 09-18-2004 12:32 PM


All times are GMT -5. The time now is 05:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration