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 this

Postby cope on Wed Nov 07, 2007 9:58 pm

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)?

You could make a root nautilus launcher: gksudo nautilus
User avatar
cope
Level 1
Level 1
 
Posts: 1
Joined: Wed Nov 07, 2007 9:47 pm

Linux Mint is funded by ads and donations.
 

Postby z0phi3l on Thu Nov 08, 2007 4:25 pm

After 2 quarters of my Linux instructor bashing into my head to never log into the ROOT account, I've found simple as firing up the terminal and "sudo nautilus" to do anything like large deletions of crap etc, other than that I'm happy using the CLI to do most admin tasks.
z0phi3l
Level 1
Level 1
 
Posts: 11
Joined: Wed Sep 26, 2007 8:32 pm
Location: Mechanicsburg, PA

Postby kenetics on Thu Nov 08, 2007 5:31 pm

"sudo nautilus" works well. Thanks.
User avatar
kenetics
Level 5
Level 5
 
Posts: 615
Joined: Thu Dec 14, 2006 9:57 pm
Location: Somewhere on a Florida beach

Postby exploder on Thu Nov 08, 2007 5:33 pm

I do not as a habit log in as root with the exception of Mondo Recovery. Mondo will not create a proper backup unless I am logged in as root. Mondo will go through the motions using sudo but the backup will be worthless.
exploder
Level 15
Level 15
 
Posts: 5876
Joined: Tue Feb 13, 2007 10:50 am
Location: HartfordCity, Indiana USA

hehe

Postby dracorX on Fri Nov 09, 2007 5:53 am

Graphical Root access is the root for disaster ;-)

No joking around anymore, I do have graphical root access configured as well. I use it quite often: twice per year hehe.

Sometimes, for very specific tasks, I rather login graphically than somehow different.
User avatar
dracorX
Level 3
Level 3
 
Posts: 181
Joined: Tue Sep 18, 2007 7:25 am

Re: Log in as Root

Postby hannu on Wed Dec 23, 2009 9:01 pm

leslie wrote:Hello people. Nice to be with you!

Just trying mint. By some amazing luck I managed to get my ATI card installed ok. Phew, lotta hassle with Ubunto based distros I believe? Anyway, top marks for a nice functioning distro. To my question -

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


There are ways to login as root, but it may be also important to actually take over the root account. This is usually necessary for production servers etc. where you the administrator has the root account and others do not.
By default, desktop style Linux distros do not offer the root password to be set during the original installation, but allow the user to have sudo privileges.
This is how you take over the root account if you are a normal Mint/Ubuntu user with the sudo option:
sudo passwd root
- the system will ask first for your password, then prompts you to set (change) the root password.
Once you have set (changed) the root password, don't forget it. You can then disable the sudoing options in /etc/sudoers.
Now you can become root at will, just type:
su
Operating a Linux system as root is not as dangerous as some people say. Don't delete files or change settings unless you know what you are doing. For many server systems, almost all setups, reading log files, adding users, etc. have to be done as root, so what's the point of sudoing all the time.
sudo is equally as dangerous. What if you by mistake add sudo users who all can do the above?
Hannu
hannu
Level 1
Level 1
 
Posts: 18
Joined: Wed Jan 07, 2009 11:32 pm

Re: Log in as Root

Postby Fred on Wed Dec 23, 2009 10:40 pm

Many in this thread are confusing the pros and cons of using the sudo system and the traditional root - user password system with logging into a X session as root.

Starting a X session as root is wrong in almost every instance, regardless of how you do it. I haven't felt the need to do that in years. There are better, more secure ways of doing anything that you think you need a root X session for. It isn't a matter of you being in control of your computer. It is in fact the opposite. Running an X session as root means that you don't know enough about your system to do it correctly. You have given up control of your computer to the world, if you are or have been connected to the internet, in an attempt to do something that you don't know how to do correctly. You have actually given up control, not taken 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.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Log in as Root

Postby phonecian on Sun Jan 03, 2010 8:14 pm

First, its great to find these threads so easily in the Forum. The issue is - predictably - a big one.

After reading through the contributions, I'm moved to comment too. I came to Mint recently after being a long time user of Xandros (also Debian) and Mint's lack of root user login (to perform network configurations etc.) is driving me nuts. It would be ok to sudo into root (as some have suggested) and configure through VI if, - just if - , VI was even as minimally intelligent as I remember it used to be years ago. But it isn't. For reasons as mysterious as string theory, its been 'updated' so a careless key touch now automates it right back out of its edit mode leaving characters scattered, lines spaced and so on - all to be patiently reworked again and again. An OS that, in the 21st century, still can't offer an easy graphical configuration interface its designers consider 'safe' is - in my view - already somewhat obsolete.

I like Mint in all other respects so I'm pressing on to see if I can make it work as I like an OS to work. But as I try to work it out I can't escape a sense of deja vue. Wasn't it Microsoft who put the secrecy into operating systems forcing users to adopt a mindless 'out of the box' mentality? Wasn't that the reason I came to hate Windows in the first place?
phonecian
Level 1
Level 1
 
Posts: 8
Joined: Tue Nov 03, 2009 8:18 am

Re: Log in as Root

Postby Fred on Sun Jan 03, 2010 10:44 pm

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.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Log in as Root

Postby phonecian on Mon Jan 04, 2010 12:51 am

Thanks Fred ... so that's it. Thank Heavens progress IS going forwards after all.
phonecian
Level 1
Level 1
 
Posts: 8
Joined: Tue Nov 03, 2009 8:18 am

Re: Log in as Root

Postby Znote on Thu Jan 28, 2010 9:39 am

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. :)
Znote
Level 1
Level 1
 
Posts: 39
Joined: Thu Dec 17, 2009 8:14 am

Re: Log in as Root

Postby Fred on Thu Jan 28, 2010 2:22 pm

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.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Log in as Root

Postby Znote on Fri Jan 29, 2010 8:19 am

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>"
Znote
Level 1
Level 1
 
Posts: 39
Joined: Thu Dec 17, 2009 8:14 am

Re: Log in as Root

Postby sajukk on Tue Feb 02, 2010 6:30 pm

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?
sajukk
Level 1
Level 1
 
Posts: 19
Joined: Sat May 16, 2009 3:00 pm

Re: Log in as Root

Postby Znote on Tue Mar 09, 2010 9:17 am

Very inactive, OR not helpful members here. :C
Znote
Level 1
Level 1
 
Posts: 39
Joined: Thu Dec 17, 2009 8:14 am

Re: Log in as Root

Postby DrHu on Tue Mar 09, 2010 2:10 pm

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
DrHu
Level 16
Level 16
 
Posts: 6833
Joined: Wed Jun 17, 2009 8:20 pm

Re: Log in as Root

Postby Talgon on Wed Mar 23, 2011 12:13 am

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
Talgon
Level 1
Level 1
 
Posts: 23
Joined: Tue Mar 22, 2011 7:59 pm

Re: Re:

Postby marcus0263 on Thu Mar 08, 2012 6:21 pm

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
marcus0263
Level 4
Level 4
 
Posts: 362
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle

Re: Log in as Root

Postby Miekuxi on Mon Mar 12, 2012 2:01 am

Do anyone use "sudo -s"?
:D
User avatar
Miekuxi
Level 1
Level 1
 
Posts: 23
Joined: Sun Mar 11, 2012 5:39 am

Re: Log in as Root

Postby Simtech68 on Mon Aug 05, 2013 10:32 am

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!!
Simtech68
Level 1
Level 1
 
Posts: 42
Joined: Fri Jul 12, 2013 12:29 pm

Linux Mint is funded by ads and donations.
 
PreviousNext

Return to Other topics

Who is online

Users browsing this forum: No registered users and 9 guests