LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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


Reply
  Search this Thread
Old 10-10-2006, 10:01 PM   #1
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Rep: Reputation: 30
Talking Security and "sudo" -- n00b wants your thoughts


How safe is "sudo?"

Think about it like this:

With "sudo" all you need to type to gain God status are 4 letters that everyone knows: sudo

On the other hand, if you have a root password that only you know, then only you can have God status. A root password provides a security hurdle that only the administrator can over-ride.

From this p.o.v. it seems that "sudo" is a disaster waiting to happen.

Even if "sudo" gives you root power for only one command, that still is root power in the hands of any user, not just the administrator.

What is to stop a troublesome average user from dropping one well placed "sudo" command to screw the entire system?

I'm not trying to flame "sudo" but I am just shocked to learn this and trying to describe the issue to the best of my understanding.

Please clarify and help me out.

/ Currently do not use Ubuntu based system but thinking about it, but I don't understand "sudo" and it scares me.

// Can you just use the traditional "su" method on Ubuntu instead of the new "sudo" method?
 
Old 10-10-2006, 10:26 PM   #2
aysiu
Senior Member
 
Registered: May 2005
Distribution: Ubuntu with IceWM
Posts: 1,775

Rep: Reputation: 86
You have no idea what you're talking about.

You have to be an administrator to sudo.

If a user not in the admin group tries to sudo, she'll be told that she's not in the sudoers file and can't sudo.

Also, you don't just type in four letters. You're prompted for a password, too.

Read up and get educated before you criticize:
http://help.ubuntu.com/community/RootSudo
 
Old 10-11-2006, 11:37 AM   #3
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
what's more of a security problem?
1. noob typing
Code:
noob@host:~$ sudo command
Password:
noob@host:~$ other command
Permission Denied
noob@host:~$ "Phew, I almost screwed my system"
or
Code:
noob@host:~$ su
Password:
root@host:~# command
root@host:~# other command
root@host:~# "Oh crap, I forget to type exit and just screwed my system"
You decide.
 
Old 10-11-2006, 06:51 PM   #4
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Original Poster
Rep: Reputation: 30
You two are saying

You two are saying that you must type in a password to use sudo? What password. . .a specific root / admin password or something else.

I'm coming from the MEPIS forum (MEPIS does not use sudo, it uses su) and talked to some people there. They never said anything about a sudo password on MEPIS, so I wanted to see if Ubuntu runs the same way.

I am trying to figure out if sudo behaves in MEPIS (if I installed it) like sudo behaves in Ubuntu.

BTW. . .ty for the links. . .I will look them up.
 
Old 10-11-2006, 07:06 PM   #5
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
In ubuntu to do anything as the superuser/root you need to do 2 things, first you need to be in the admin group and then you need to type sudo before the command then type in your password (like a way to confirm that you rally want to run the command). You can also set up sudo to allow a user to only a user to run a certain command or set of commands as root and not others. You configure this in the /etc/sudoers file. It's much more configurable and powerful than just su, where if you want to alow someone to run a command as root then you have to give them the keys to the whole system.
 
Old 10-11-2006, 07:59 PM   #6
aysiu
Senior Member
 
Registered: May 2005
Distribution: Ubuntu with IceWM
Posts: 1,775

Rep: Reputation: 86
Ubuntu's implementation of sudo works the same way things do in real life.

If you're just you, you can't open the door to your apartment. If you're you with a key, then you can open it.

If you're just you and an ATM card, you can't withdraw money from the ATM. If you're you with an ATM card and the PIN code for that card, you can withdraw money.

Some people are administrators. Others are not. All people generally operate as limited users most of the time.

Administrators are allowed to temporarily assume root privileges for certain tasks with their user passwords. Non-administrators can never assume root privileges.
 
Old 10-12-2006, 09:03 AM   #7
JunctaJuvant
Member
 
Registered: May 2003
Location: Wageningen, the Netherlands
Distribution: OS X & Linux Mint
Posts: 488

Rep: Reputation: 31
Quote:
Originally Posted by binary_y2k2
...
Code:
noob@host:~$ su
Password:
root@host:~# command
root@host:~# other command
root@host:~# "Oh crap, I forget to type exit and just screwed my system"
You decide.
But how about this:
Code:
user@host:~$ su -c "command"
Password:
user@host:~$
This executes only the command(s) between the quotes with root priviledges, and after that you return to being a normal user again. So I think using su does not need to pose a greater risk in this particular example.
 
Old 10-12-2006, 12:41 PM   #8
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802

Rep: Reputation: 157Reputation: 157
The big problem with sudo is that if someone cracks your admin password, then they have the whole box...

If someone cracks a user account of someone who uses su,... they also have to crack the root password...

THAT's the big problem with sudo... mine anyway.
 
Old 10-12-2006, 04:00 PM   #9
hrp2171
Member
 
Registered: Aug 2004
Location: California, USA
Distribution: Ubuntu
Posts: 243
Blog Entries: 3

Rep: Reputation: 30
Whether 'su' or 'sudo', I'm very happy to have found a way to stop using root as my main logon in Linux. I could not break away from the habit of always being signed on as root. A left over from the Windows side of my job life. What's interesting is that MS finally decided to use a 'sudo-like' system for their upcoming OS.
 
Old 10-12-2006, 08:45 PM   #10
aysiu
Senior Member
 
Registered: May 2005
Distribution: Ubuntu with IceWM
Posts: 1,775

Rep: Reputation: 86
Quote:
Originally Posted by JaseP
The big problem with sudo is that if someone cracks your admin password, then they have the whole box...

If someone cracks a user account of someone who uses su,... they also have to crack the root password...

THAT's the big problem with sudo... mine anyway.
I don't buy that at all. They're far more likely to crack root, as they already know the username (root) and the privileges that go along with it (all privileges).

Root Model:
Username - known
Privileges - known and desirable
Password - unknown

Sudo Model:
Username - unknown
Privileges - unknown (might be administrator, might not be)
Password - unknown

Three unknowns versus one unknown. If I were a cracker, I'd want to find the root password right away--screw sudo users.
 
Old 10-13-2006, 10:34 PM   #11
MBA Whore
Member
 
Registered: May 2006
Location: Kansas City, MO
Distribution: Various: pclos, Debian, Ubuntu, etc . . .
Posts: 649

Original Poster
Rep: Reputation: 30
Regardless, can anyone tell me

Regardless of "sudo" advantages and disadvantages, can anyone tell me if it is possible to use the traditional "su" method in Ubuntu / Kubuntu, etc? Or, are you stuck with the "sudo" method?

I ask because others have claimed that you can set up a Ubuntu install that uses the traditional "su" approach. . .though you might have to install something to do so, or configure certain files.
 
Old 10-13-2006, 11:15 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
One advantage to using sudo is that you can limit the commands that certain users or members of certain groups are allowed to run as root. Another advantage is that sudo commands are logged. Also, you don't need to reveal the root password that would be required if you relied on su instead. There are some commands like "less" and "vim" that allow you to run shell commands. You either need to prohibit these commands in the /etc/sudoers setup or use a secure mode of these programs (such as compiling less with the SECURE mode build in permanently.) Truly locking down what an admin sudoer user can do would be difficult; so sudo is more of a way of securing the secret of root's password and allowing root tasks to be done without developing the habit of su'ing to root all of the time to do it. You still have to be carefull who you allow root tasks to, with or without sudo.
 
Old 10-14-2006, 01:37 AM   #13
jon23d
Member
 
Registered: May 2006
Location: Kennewick, WA - USA
Distribution: Ubuntu
Posts: 129

Rep: Reputation: 15
Quote:
Originally Posted by MBA Whore
Regardless of "sudo" advantages and disadvantages, can anyone tell me if it is possible to use the traditional "su" method in Ubuntu / Kubuntu, etc? Or, are you stuck with the "sudo" method?

I ask because others have claimed that you can set up a Ubuntu install that uses the traditional "su" approach. . .though you might have to install something to do so, or configure certain files.
In Ubuntu the root account is still present, the password just isn't set. Well, it may be set, but certainly not to anything you specify. You could renable by issuing the command 'sudo passwd root'; however, I find it easier to use 'sudo su' to switch to root when I have to. In fact, I use this same method for the non-debian distros that I use as well. It works quite well. The ability to hand out access for just a few commands is really helpful.
 
Old 10-14-2006, 07:18 PM   #14
josephus
LQ Newbie
 
Registered: Oct 2006
Posts: 1

Rep: Reputation: 0
Confused me too

I have been installing various distros, having fun and learning about them. I'm using a couple of old laptops to do this.
But I was surprised when the Ubuntu install didn't ask me to set a root password, just a user name and password. Then when I was trying to install new software or update or something I had to go searching google to find out what to do. I found some info about "sudo passwd root". I thought that would set a root password for me, but no, it just took my user password and gave me root privileges. So ... I am still kind of confused why it would work that way, but now, whenever I want to do something that requires root I just have to input the same password I logged in with as user. That doesn't make sense to me.
Other than that I think Ubuntu is real slick and zippy, including on old hardware, which is what I am experimenting with.
 
Old 10-14-2006, 10:43 PM   #15
aysiu
Senior Member
 
Registered: May 2005
Distribution: Ubuntu with IceWM
Posts: 1,775

Rep: Reputation: 86
Why doesn't that make sense to you?

Mac users don't seem to be confused by it, and Mac OS X uses sudo the same way Ubuntu does.

If you're an admin user, you enter your password to perform admin tasks.

That makes sense. It's a culture shock to you because you're used to other distros that have a root account. But really... think about it--why should need a separate root account to perform administrative tasks?
 
  


Reply



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
Can you have "sudo" automatically added to each line in the CLI? Free_beer Ubuntu 7 09-29-2006 03:59 PM
Services and "sudo ifdown eth0" on boot? J_K9 Linux - General 5 07-14-2005 04:35 AM
how do I get around the "submit passwd" prompt in ubuntu even if I use "sudo"? t3gah Linux - Distributions 1 02-22-2005 04:42 PM
Problem with "sudo" command on Fedora Core 2 maatghandi Linux - Newbie 1 10-30-2004 09:25 AM
normal user want to perform "init 6" by using " sudo acbenny Linux - General 3 08-08-2004 07:41 AM

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

All times are GMT -5. The time now is 10:10 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