LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


View Poll Results: Which of the following uses of sudo do you prefer to gain root?
sudo -s 5 12.20%
sudo -i 10 24.39%
sudo su 24 58.54%
sudo bash 5 12.20%
Multiple Choice Poll. Voters: 41. You may not vote on this poll

Reply
  Search this Thread
Old 10-02-2010, 09:17 PM   #1
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
Preferred use of sudo for root-gaining


Which use of sudo do you prefer to get a root shell? Please explain your votes in detail in corresponding posts.
 
Old 10-02-2010, 09:53 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Code:
sudo su -
Note the -. Because it replicates root's environment closely and that's how I've always done it.
 
Old 10-03-2010, 11:10 AM   #3
verndog
Member
 
Registered: Oct 2007
Posts: 278

Rep: Reputation: 67
I use
Code:
sudo su
because it keeps me in my home environment. That's usually where I want to be anyway.
 
Old 10-03-2010, 12:17 PM   #4
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,884
Blog Entries: 28

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
None of the above.
 
Old 10-03-2010, 03:28 PM   #5
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791

Original Poster
Blog Entries: 62

Rep: Reputation: 56
I use either sudo su root, sudo -s, sudo su -, or, if in a GUI (in the Alt+F2 run dialog):

Code:
gksudo gnome-terminal #or "kdesudo konsole"
which will simply run a terminal emulator window as root to start with. Sorry if this hasn't been included in the poll; I should have included this option.
 
Old 10-03-2010, 09:39 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
sudo su because I usually need to do more than one thing.
 
Old 10-03-2010, 10:07 PM   #7
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
None of the above.

sudo do this
sudo do that

etc.

Last edited by snowday; 10-07-2010 at 10:57 AM.
 
0 members found this post helpful.
Old 10-04-2010, 02:49 AM   #8
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791

Original Poster
Blog Entries: 62

Rep: Reputation: 56
Quote:
Originally Posted by frankbell View Post
sudo su because I usually need to do more than one thing.
How about pressing Alt+F2 and typing gksudo gnome-terminal?
 
Old 10-04-2010, 05:17 PM   #9
X.Cyclop
Member
 
Registered: Jun 2006
Location: Tlv
Distribution: Arch!
Posts: 120

Rep: Reputation: 21
None of the above... i never use that. If i have to do something i just type sudo <command> (isn't it unsecure to gain root access?).
 
Old 10-04-2010, 07:48 PM   #10
Rambo_Tribble
Member
 
Registered: Aug 2005
Location: N 44 Deg. 56.537' W 123 Deg. 3.683'
Distribution: Kubuntu, MEPIS, SUSE & Debian
Posts: 30

Rep: Reputation: 19
Quote:
Originally Posted by X.Cyclop View Post
... (isn't it unsecure to gain root access?).
Sudo was designed, in about 1980, to selectively allow non-root users to perform specific activities with root or another user's permissions. More recently, Ubuntu has used sudo as a kludge to prevent users from gaining root permissions, usually through su, and inadvertently continuing to run as root beyond performing the activity that needed the root permissions. This was envisioned as a way to prevent users unfamiliar with the POSIX permissions system from running unsecured.

Opinions vary as to whether this is good, bad or indifferent in practice. It can certainly mean more typing. Many experienced Unix/Linux administrators choose to circumvent Ubuntu's use of sudo, for this reason. Such administrators have learned to religiously relinquish root status as soon as they no longer need it.

To be clear, it is dangerous, as Windows users have found, to consistently run as root. But virtually any self-inflicted damage that can be done running under su can just as easily be done with sudo. Starting Firefox with "sudo firefox" is just as dangerous as running "firefox" while logged in as root. The only real difference is the ease with which a negligent user could do one or the other inadvertently. In other words, sudo is just another, more restrictive, (and some would say, more tedious), way to achieve root access in the case of Ubuntu. Sudo can be used in far more ways to selectively grant permissions on multi-user systems, however, than is dreamt of in Canonical's philosophy.

Last edited by Rambo_Tribble; 10-05-2010 at 08:24 AM.
 
1 members found this post helpful.
Old 10-04-2010, 08:17 PM   #11
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
I don't use any of the above methods for gaining root permissions I just use su like it was intended..... I believe that sudo in most distros is too liberal in its allowing specific users to run anything as sudo. In some cases it really is just pointless to have it there since a normal user can run anything with sudo thus making them a superuser anyway. Better to limit sudo to allowing users to run specific commands that a normal user may run and need elevated permissions. I find the only times I need super user access is when I am editing a file in /etc or doing kernel work.

Then again I am not your normal ubuntu user either so. I guess its better then creating them as a admin user.
 
Old 10-05-2010, 11:54 AM   #12
faginbagin
LQ Newbie
 
Registered: Nov 2007
Distribution: Debian, Ubuntu, Mythbuntu
Posts: 21

Rep: Reputation: 5
I use "sudo bash" long enough to set a root password on a fresh install, then I use "su -" so I can have the shell environment the way I like it. But I've also been a *nix user & software developer since the early 1980s.
 
Old 10-05-2010, 12:00 PM   #13
pr_deltoid
Member
 
Registered: Jun 2010
Distribution: Fedora
Posts: 289

Rep: Reputation: 41
"sudo program" and "su -"
 
Old 10-05-2010, 02:12 PM   #14
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
sudo -i
The practice recommended on my last foray into the land of Canonical docs.

For the record, AFAIAC one password for both regular & root access is pseudo security.

Last edited by archtoad6; 10-05-2010 at 02:15 PM.
 
Old 10-05-2010, 02:31 PM   #15
Rambo_Tribble
Member
 
Registered: Aug 2005
Location: N 44 Deg. 56.537' W 123 Deg. 3.683'
Distribution: Kubuntu, MEPIS, SUSE & Debian
Posts: 30

Rep: Reputation: 19
Quote:
Originally Posted by archtoad6 View Post
For the record, AFAIAC one password for both regular & root access is pseudo security.
Of course, your statement has merit, but there is a trade-off one must consider: When the password for the root account gets lost, and patches aren't made to the kernel and applications, security suffers as well. Since the root password gets used less than the user one, it is more likely to be lost or forgotten.

In a more perfect world, only computers would be allowed to use computers. Or something like that.
 
1 members found this post helpful.
  


Reply

Tags
preferred use, sudo



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
User executable script gaining root privileges w/o passwd neoAKiRAz Linux - General 6 09-06-2007 04:22 PM
Gaining root access to file manager Rick069 Linux - Software 2 04-27-2007 10:24 PM
gaining root access thebiggiantmouse Ubuntu 5 09-19-2006 03:53 AM
Gaining root access in Gnome jonasan Linux - Software 5 01-31-2006 11:11 AM
Gaining root access in KDE d-katz Linux - General 9 02-27-2004 05:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 08:05 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
Open Source Consulting | Domain Registration