LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 08-08-2006, 07:04 PM   #1
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,440

Rep: Reputation: 80
sudo is junk in ubuntu. thinking about adding a root user.


Without using any of these commands or ones similar to it, 'sudo -s`, `sudo -i`, `sudo -K`, 'sudo su', and `sudo chown $USER /etc/apt/sources.list`, how can I get this to work? I also do not want to use a text editor or do this by some other way. I wan't to figure out why this is not working.

ubuntu@ubuntu:~$ sudo echo "deb http://kubuntu.org/packages/amarok-latest dapper main" >> /etc/apt/sources.list
bash: /etc/apt/sources.list: Permission denied
ubuntu@ubuntu:~$
 
Old 08-08-2006, 07:20 PM   #2
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 3,177

Rep: Reputation: Disabled
So what are those permissions?

ls -l /etc/apt/sources.list
 
Old 08-08-2006, 07:43 PM   #3
Xena
Member
 
Registered: Nov 2005
Posts: 84

Rep: Reputation: 15
I'd suggest it's not working because you need to be root to do that.

I'd suggest that there's no root account on ubuntu as a security feature; since all linux boxes have "root" as an account it could be possible to brute force hacking in by accessing the root account with every possible combination of passwords. That's why ubuntu has no root account.

And that's why you need sudo <command> a lot of the time, it prompts you to think before potentally destroying some vital part of your system.

Which leaves you either using sudo, or using a text editor with root access level.
 
Old 08-08-2006, 08:08 PM   #4
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,440

Original Poster
Rep: Reputation: 80
Quote:
Originally Posted by Emerson
So what are those permissions?

ls -l /etc/apt/sources.list
the permissions shouldnt matter. root user can do anything he or she wants. im trying to figure out why this command is not working, so changing the permissions wouldn't tell me that.
 
Old 08-08-2006, 08:16 PM   #5
seneschal
LQ Newbie
 
Registered: Jul 2006
Location: Minnesota
Distribution: RHEL, Debian, Ubuntu
Posts: 27

Rep: Reputation: 15
Why can't you just use sudo -s for a minute, do your command, then go back to your normal user? That's why sudo provides the ability to spawn a shell.
 
Old 08-08-2006, 08:22 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by Xena
I'd suggest it's not working because you need to be root to do that.

I'd suggest that there's no root account on ubuntu as a security feature; since all linux boxes have "root" as an account it could be possible to brute force hacking in by accessing the root account with every possible combination of passwords. That's why ubuntu has no root account.

And that's why you need sudo <command> a lot of the time, it prompts you to think before potentally destroying some vital part of your system.

Which leaves you either using sudo, or using a text editor with root access level.
Ubuntu DOES have a root account--it is disabled by default.

Easy to fix:
sudo passwd root
enter your normal password
enter the new root password at the prompt

The lack of a root user in the default Ubuntu setup is hardly a "feature"--IMHO, it is one of the few flaws in Ubuntu.
If you are setting up someone on Ubuntu who cannot be trusted not to screw things up, then having sudo privileges will not give any protection. Give them an account iwth limited powers.
 
Old 08-08-2006, 08:23 PM   #7
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 3,177

Rep: Reputation: Disabled
By any chance, you didn't break the line after >> ?

sudo echo "deb http://kubuntu.org/packages/amarok-latest dapper main" >> /etc/apt/sources.list
 
Old 08-08-2006, 09:01 PM   #8
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,440

Original Poster
Rep: Reputation: 80
I found a good command that does pretty much the same thing, appending a line of text to the end of a file.

Code:
echo "deb http://kubuntu.org/packages/amarok-latest dapper main" | sudo tee -a /etc/apt/sources.list
 
Old 08-08-2006, 09:03 PM   #9
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,440

Original Poster
Rep: Reputation: 80
Quote:
Originally Posted by Emerson
By any chance, you didn't break the line after >> ?

sudo echo "deb http://kubuntu.org/packages/amarok-latest dapper main" >> /etc/apt/sources.list
i am not sure what you mean. could you explain that more?
 
Old 08-08-2006, 09:25 PM   #10
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 3,177

Rep: Reputation: Disabled
Code:
ubuntu@ubuntu:~$ sudo echo "deb http://kubuntu.org/packages/amarok-latest dapper main" >>
/etc/apt/sources.list
bash: /etc/apt/sources.list: Permission denied
ubuntu@ubuntu:~$
This is how it looks in my browser, the line is broken. Which does not mean it wasn't one line when you wrote it.
 
Old 08-08-2006, 11:15 PM   #11
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 4.0 Etch
Posts: 1,349

Rep: Reputation: 49
Quote:
Originally Posted by Xena
I'd suggest that there's no root account on ubuntu as a security feature; since all linux boxes have "root" as an account it could be possible to brute force hacking in by accessing the root account with every possible combination of passwords. That's why ubuntu has no root account.
Which is a complete non-feature, because the exact same brute force attack could be used to figure out the sudo-capable user's account. Which gives him root access.

Quote:
And that's why you need sudo <command> a lot of the time, it prompts you to think before potentally destroying some vital part of your system.
If you want to use sudo because it psychologically helps you do things safely, then you can feel free to do so by installing/configuring sudo on your system. That's no reason to have the root account disabled by default.
 
Old 08-09-2006, 04:44 AM   #12
Xena
Member
 
Registered: Nov 2005
Posts: 84

Rep: Reputation: 15
Technically, yes, practically, no.

If I try every combination of aaaaa to zzzzz as passwords, for example, for the user "root" I need to try 11 million times.

If there's no "root" account enabled, then I must try every combination of usernames aaaaa to zzzzz with password aaaaa to zzzzz, which is 11 million times 11 million times, which is rather a lot and probably beyond the patience of all but the most determined.

So, I'd count this as a very good "non-feature"
 
Old 08-09-2006, 07:53 AM   #13
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 4.0 Etch
Posts: 1,349

Rep: Reputation: 49
You're making the assumption that the hacker doesn't already know the username, despite it probably appearing on the login screen, e-mails, and other publicly accessable things.

A user name, unlike a password, is going to be something easy to guess. Unlike passwords, user names are NOT supposed to be something with randomish alphanumerics+symbols. User names are NOT hidden within the file system. User names are NOT considered secure. The entire universe of *nix software has been written with the assumption that passwords are supposed to be secret and usernames are NOT.

Besides, any sort remote login of the root user shouldn't be enabled, whereas disabling remote login of the main normal user is unlikely if remote login is used at all.
 
Old 08-09-2006, 07:54 AM   #14
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by Xena
Technically, yes, practically, no.

If I try every combination of aaaaa to zzzzz as passwords, for example, for the user "root" I need to try 11 million times.

If there's no "root" account enabled, then I must try every combination of usernames aaaaa to zzzzz with password aaaaa to zzzzz, which is 11 million times 11 million times, which is rather a lot and probably beyond the patience of all but the most determined.

So, I'd count this as a very good "non-feature"
Do the same thing by having longer passwords......

The Ubuntu authors did not disable root to enhance security--they did it to protect the user from doing something dumb---and maybe make the system "simpler".

Old saying: "Make it idiot-proof, and I will find you an idiot who can screw it up." IMHO, if you follow standards, you have a more user-friendly and idiot-tolerant interface.
 
Old 08-09-2006, 08:52 AM   #15
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 46
Quote:
Originally Posted by fakie_flip
Without using any of these commands or ones similar to it, 'sudo -s`, `sudo -i`, `sudo -K`, 'sudo su', and `sudo chown $USER /etc/apt/sources.list`, how can I get this to work? I also do not want to use a text editor or do this by some other way. I wan't to figure out why this is not working.

ubuntu@ubuntu:~$ sudo echo "deb http://kubuntu.org/packages/amarok-latest dapper main" >> /etc/apt/sources.list
bash: /etc/apt/sources.list: Permission denied
ubuntu@ubuntu:~$
How about

ubuntu@ubuntu:~$ sudo 'echo "deb http://kubuntu.org/packages/amarok-latest dapper main" >> /etc/apt/sources.list'

I think the problem might be that it tries to redirect the output of sudo to /etc/apm/sources.list instead of the output of the command echo. Now since you run sudo as a regular user (i.e. start it as a regular user), it doesn't have permissions to write to that file. Echo command on the other hand does because it's started as root.

Last edited by alienDog; 08-09-2006 at 08:59 AM.
 
  


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
alsa work with root or sudo but not user walterbyrd Linux - Hardware 5 10-24-2005 01:53 PM
Running a script as root with sudo without entering the user password kloss Linux - General 8 10-10-2005 11:39 AM
allow sudo for www user to run root shell script cccc *BSD 12 07-23-2005 03:48 PM
adding root permisions to regualr user paul62 Linux - Newbie 6 10-27-2004 01:10 PM
SUDO as *non-root* user spratty Linux - Newbie 3 05-19-2004 03:35 AM


All times are GMT -5. The time now is 12:03 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration