Log in as Root

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
User avatar
Fred
Level 10
Level 10
Posts: 3337
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Log in as Root

Post by Fred »

phonecian,

Where did you come up with the Vi example? In a user X session open a terminal and type:

gksu gedit
or
kdesu kate
or whatever GUI editor you prefer. You don't need to log into a root X session to edit graphically as root. And you certainly don't want to run a GUI desktop as root.

As I pointed out, logging into an X session as root is giving up control, not gaining control.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
phonecian
Level 1
Level 1
Posts: 8
Joined: Tue Nov 03, 2009 8:18 am

Re: Log in as Root

Post by phonecian »

Thanks Fred ... so that's it. Thank Heavens progress IS going forwards after all.
Znote
Level 1
Level 1
Posts: 39
Joined: Thu Dec 17, 2009 8:14 am

Re: Log in as Root

Post by Znote »

I had problems with root. I wanted a GUI admin way to move, delete, edit text documents for my web server.
(The reason I use GNOME installed OS as webserver is because I am tired of Windows, I want to learn Linux, I suck in linux. And I felt comforted about using a Linux GUI solution). With a successful setup and use of webserver I will later on move to a terminal only, probably pure Debian server.

Thanks for sudo nautilus, worked the way I wanted! :D (Except scary console error)

Code: Select all

stefanab-desktop www # sudo nautilus

(nautilus:7749): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed
Initializing nautilus-open-terminal extension
Initializing nautilus-gdu extension
Looks like I got a rather dangerous critical error? But it works. No idea what the error is. :)
User avatar
Fred
Level 10
Level 10
Posts: 3337
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Log in as Root

Post by Fred »

Znote wrote:
Thanks for sudo nautilus, worked the way I wanted!
No, actually it doesn't work the way you want. Using sudo to launch an X based GUI program is a bad habit to get into. Yes it works, but over time it will break your desktop. One of the first symptoms will be that you can't launch the GUI program as root. From there it just gets worse. What happens is the user and root profiles get corrupted.

The proper way to launch an X based GUI program in Gnome and KDE is with:

gksu program_name

for Gnome and

kdesu program_name

For KDE. If you will get into the habit of always doing it like that you will not have nearly as many strange reactions from your Desktop. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
Znote
Level 1
Level 1
Posts: 39
Joined: Thu Dec 17, 2009 8:14 am

Re: Log in as Root

Post by Znote »

Fred wrote:Znote wrote:
Thanks for sudo nautilus, worked the way I wanted!
No, actually it doesn't work the way you want. Using sudo to launch an X based GUI program is a bad habit to get into. Yes it works, but over time it will break your desktop. One of the first symptoms will be that you can't launch the GUI program as root. From there it just gets worse. What happens is the user and root profiles get corrupted.

The proper way to launch an X based GUI program in Gnome and KDE is with:

gksu program_name

for Gnome and

kdesu program_name

For KDE. If you will get into the habit of always doing it like that you will not have nearly as many strange reactions from your Desktop. :-)

Fred
How come? Like a sickness? :S When a program work, it works. Right? :S

When I don't use sudo nautlius~ thingy, it end up with annoying error messages "Permission Denied". So I have to grant permission to do it! :/

Look:

Code: Select all

stefanab@stefanab-desktop /etc $ cd hosts
bash: cd: hosts: Not a directory
stefanab@stefanab-desktop /etc $ ./hosts
bash: ./hosts: Permission denied
stefanab@stefanab-desktop /etc $ gksu ./hosts
stefanab@stefanab-desktop /etc $ 
I wanted to edit the text inside host, but after opening it with gksu nothing happens! Does not work! :C Thats why I use nautlilus, then I can edit it with gedit. And it work. :)

Code: Select all

stefanab@stefanab-desktop ~ $ ping meatspin
PING meatspin (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.070 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.038 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.037 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.038 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.039 ms
64 bytes from localhost (127.0.0.1): icmp_seq=6 ttl=64 time=0.037 ms
64 bytes from localhost (127.0.0.1): icmp_seq=7 ttl=64 time=0.040 ms
64 bytes from localhost (127.0.0.1): icmp_seq=8 ttl=64 time=0.035 ms
64 bytes from localhost (127.0.0.1): icmp_seq=9 ttl=64 time=0.036 ms
64 bytes from localhost (127.0.0.1): icmp_seq=10 ttl=64 time=0.037 ms
64 bytes from localhost (127.0.0.1): icmp_seq=11 ttl=64 time=0.039 ms
uashaushasuh it works woop woop! :D

It never stopped! On windows it stops after 4 echo attempts.

I had to be ebil and kill the computer terminal window. xD

As you guys might have understood. Yep, I'm a complete noob newbeginner at Linux. Been using Windows for 10 years though. :P /But, for some reason, I don't feel like my windows knowledge help me anything, actually, I believe it does nothing else than confusing me.

Hmm, this made me think.

Is it impossible to edit a document containing text, if you don't got graphical interface? Cant think of any good terminal text document options. xD "

cd index.html +ls (opens and display the contents of the index.html, displaying rows and cols).
sudo edit index.html row "3" replace "col 3 - 10" value "</body>"
n0body_special
Level 2
Level 2
Posts: 72
Joined: Sat May 16, 2009 3:00 pm

Re: Log in as Root

Post by n0body_special »

Fred wrote:Znote wrote:
Thanks for sudo nautilus, worked the way I wanted!
No, actually it doesn't work the way you want. Using sudo to launch an X based GUI program is a bad habit to get into. Yes it works, but over time it will break your desktop. One of the first symptoms will be that you can't launch the GUI program as root. From there it just gets worse. What happens is the user and root profiles get corrupted.

The proper way to launch an X based GUI program in Gnome and KDE is with:

gksu program_name

for Gnome and

kdesu program_name

For KDE. If you will get into the habit of always doing it like that you will not have nearly as many strange reactions from your Desktop. :-)

Fred
Holy crap, i had no idea that it's so important, i thought that sudo and gksu did the same thing! Noob here...
Now i realize, when i am in root terminal using su and type "gedit /etc/fstab", i always get flooded by

Code: Select all

(gedit:5232): GVFS-RemoteVolumeMonitor-WARNING **: cannot connect to the session bus: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
The screen gets really flooded, we are talking about large quantities of SPAM, many repetitions until, in the end, gedit appears.
apart from advising me to use gksu gedit, anybody knows what this error message is?
Windows is the world's biggest virus.
UEFI is a Microsoft sponsored boot sector hijacker.
Android is the world's biggest spyware.
Google and Microsoft will one day merge into Skynet
Znote
Level 1
Level 1
Posts: 39
Joined: Thu Dec 17, 2009 8:14 am

Re: Log in as Root

Post by Znote »

Very inactive, OR not helpful members here. :C
User avatar
DrHu
Level 17
Level 17
Posts: 7522
Joined: Wed Jun 17, 2009 8:20 pm

Re: Log in as Root

Post by DrHu »

Znote wrote:
Is it impossible to edit a document containing text, if you don't got graphical interface? Cant think of any good terminal text document options. xD
Very inactive, OR not helpful members here. :C
Very inactive, OR not helpful members here. :C
I don't know what that means, but..
  • Alt F1
    --gets login prompt
    root
    --if you have a root account enabled..
    Now, unlike windows OS you have a separate user session associated with the root login
  • Vim
    --easier than emacs editor
    Emacs
    -power editor
    nano
    --simple editor
Terminal/text editors..Linux
http://fixunix.com/ubuntu/509025-easy-t ... ditor.html
http://www.linuxlinks.com/Software/Editors/Console/
User avatar
Talgon
Level 1
Level 1
Posts: 23
Joined: Tue Mar 22, 2011 7:59 pm

Re: Log in as Root

Post by Talgon »

leslie wrote:I am trying to login as root/admin but apparently I can't do that from the login screen? What's up?. That's ok if I can get file access with a kinda Super User Mode editor, has mint got one? - Oh, rather not use Terminal.

Cheers
Les
you can login from the login screen. Go to "Other..." and type in "root" for the user and then put in the password you use to authenticate root commands in the terminal.

Example: You type:
sudo apt-get install gedit
You get:
[sudo] password for (your name):
The password you put in will be the password you use.
-----------------------------------------------------------------------------------------------
Also what you could do is just login from the terminal while in your regular user.

Example of mine:
brent@brent-Inspiron-600m ~ $ sudo su
[sudo] password for brent:
brent-Inspiron-600m brent #

Now you are logged in as the root in that terminal. But, as soon as you close it you lose the login.
"Be as smart as you can, but remember that it is always better to be wise than to be smart."
-Alan Alda
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Re: Re:

Post by marcus0263 »

kenetics wrote:I know how to login as root, but without being in root how would one do something like adding XMMS skins to usr/share/xmms/skins? Or easily delete a bunch of unwanted wallpapers in usr/share/backgrounds (can only do 1 at a time in Desktop Background menu)?
Need root?

sudo su - root

Ten do a simple

rm <file name>

Sent from my Xoom using Tapatalk
Shuttle SX58
Intel i7 Gulftown Hex Core
G.Skill 16Gig 1333
OCS Vertex 2 SSD
Segate SATA II
Palit GeForce GTS 450
LMKDE 14 64Bit

Where Thought Crime is Committed
Reject the Herd
User avatar
Miekuxi
Level 1
Level 1
Posts: 28
Joined: Sun Mar 11, 2012 5:39 am

Re: Log in as Root

Post by Miekuxi »

Do anyone use "sudo -s"?
:D
Simtech68
Level 1
Level 1
Posts: 41
Joined: Fri Jul 12, 2013 12:29 pm

Re: Log in as Root

Post by Simtech68 »

After reading all of the post in this thread I just have one thought to put forth. The Linux community prides itself on open and free software, yet there seems to be a "you don't need to look behind the curtain" for such things as root logins.

Here's my take, give people what they want, if they want to feel total control of there OS, let them have it. Of course be a good citizen and give them a fair warning about the potential of "hosing their system up" and "losing all of their stuff" and "wiping the hard drive clean". But let them do with it what they will. I have found in my experience that people sometimes learn best through their own experiences, trial and error The mentality of " oh don't worry about that, you'll never need to use that for any reason" sounds elitist, like some know more than other and are not willing to share, like their is a secret to be kept.

Now to be clear I'm not pointing the finger at any post or any one in this thread, 'mI just posting my opinions after reading this entire thread. Yes I'm new to Linux but I have work with Unix for years. I have come to value the "su" as a tool that is useful but also dangerous if used improperly.

BTW, thank to all that posted in this thread, I found some very useful nuggets of information!!!!
Details, details, and more details will help get the answers you seek!!
User avatar
grimdestripador
Level 6
Level 6
Posts: 1051
Joined: Fri Feb 16, 2007 2:26 am

Re: Log in as Root

Post by grimdestripador »

I control what I do to my computers
This is an issusion of control. The basis of the logic stems from the flawed logic of more 'power' = more 'control; Do you sharpen a pensil with a wood chipper? By having too much power, you actually have less control. When logged into a GUI as a normal user, you know the limits of your actions. You know the scope of our actions; No extra code is ran. No system modifications are achieved outside of what was permitted. That is control, the system escilated privilages just enough to perform an action, performs only the action requested and reports back to me what its results are.

You really want a user with super-user privilages. Because root, is not a standard user. Linux programs are written under the assumption that they will be ran as a standard user.

You want control? Learn how to control not brute.
lsatenstein
Level 1
Level 1
Posts: 16
Joined: Sat Dec 03, 2011 2:33 pm

Re:

Post by lsatenstein »

kenetics wrote:I know how to login as root, but without being in root how would one do something like adding XMMS skins to usr/share/xmms/skins? Or easily delete a bunch of unwanted wallpapers in usr/share/backgrounds (can only do 1 at a time in Desktop Background menu)?
When you deal with many files, that you receive, and have to move groups of them, based on certain names to other users directories, then you need to log to command line and do it one at a time.

Just look at the following type of situation

mv gronk*.doc /home/OtherUser/Documents
rm gronk *.doc

With command line, the error is "Whoops", I did not mean to delete *.doc

With GUI interface as Root, it is a select, cut, paste and the redistribution is mostly done. (What will be left to do will be changing ownership and possibly file permissions)
That is why allowing root in GUI is now the norm. Root login is protected by a password.
Simtech68
Level 1
Level 1
Posts: 41
Joined: Fri Jul 12, 2013 12:29 pm

Re: Log in as Root

Post by Simtech68 »

No offense but the same thing could happen in a GUI just as well......"Whoops I didn't mean to click that...."

Just like with any powerful tool care must be used and checks must be done, assuming leads to mistakes.

Quite frankly "rm" and "mv" are two totally different types of key strokes
Details, details, and more details will help get the answers you seek!!
User avatar
js3915
Level 3
Level 3
Posts: 177
Joined: Fri Jul 05, 2013 5:35 pm

Re: Log in as Root

Post by js3915 »

lsatenstein wrote: mv gronk*.doc /home/OtherUser/Documents
rm gronk *.doc

With command line, the error is "Whoops", I did not mean to delete *.doc
Its possible to accidently delete a whole folder too in a gui
lsatenstein wrote:With GUI interface as Root, it is a select, cut, paste and the redistribution is mostly done. (What will be left to do will be changing ownership and possibly file permissions)
That is why allowing root in GUI is now the norm. Root login is protected by a password.
Dont need to login via root simply a user with Sudo access can right click on a folder choose open as root enter in your password will elevate your file manager temporarily till you close file manager and you can move edit delete etc. No need to log out and log into root then back out and into your normal account.
dupek

Re: Log in as Root

Post by dupek »

Some asked a simple question and got %99 wrong response. Too many dumb ass "preachers" concern about the safety of a piece of software. Ubuntu is worst that Windows and with more secrets that Vatican. I tested many distros and the Slack based are the best as they do not rob you of your freadom. If I mess up - not a big deal. In 10 min and have my MBR ( dual boot with Win7) restore and Linux partition wipe out. Ready to reinstall. Right now, downloading anothe distro and see how this goes. Linux was supposed to be free - free whatever to hell I want. Sorry Mint - I do not like secrests.
User avatar
Pilosopong Tasyo
Level 6
Level 6
Posts: 1435
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: Log in as Root

Post by Pilosopong Tasyo »

Read the forum rules. Locked for necroposting.
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
Locked

Return to “Other topics”