LinuxQuestions.org
Help answer threads with 0 replies.
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 09-04-2010, 04:57 AM   #1
john83reuben
Member
 
Registered: Oct 2007
Location: Kuala Lumpur,Malaysia
Distribution: Debian Etch, OpenSuse
Posts: 132

Rep: Reputation: 17
login to root without password (ubuntu 8.04)


Hi All,

When I try to do

Quote:
sudo su root
The login is successful without prompting a password. This is dangerous.
How am I going to avoid/disable this?

Thanks

Jon

Last edited by john83reuben; 09-04-2010 at 05:28 AM. Reason: I change with to without
 
Old 09-04-2010, 05:20 AM   #2
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 100Reputation: 100
I don't understand. Why do you think prompting a password is dangerous? If you want to login without password, you can add the line below to /etc/sudoers:
Code:
<your_user>	ALL=(ALL)	NOPASSWD:ALL
 
Old 09-04-2010, 05:27 AM   #3
john83reuben
Member
 
Registered: Oct 2007
Location: Kuala Lumpur,Malaysia
Distribution: Debian Etch, OpenSuse
Posts: 132

Original Poster
Rep: Reputation: 17
Hi quanta,

I mean i login to the machine as a normal user, ..lets say john

This is what happens

Quote:

john@john-laptop:~$ sudo su root
root@john-laptop:/home/john#
I was able to access root without a password. I am afraid if others was using my box, and this might be a problem if they access my root account.

Thanks

John
 
Old 09-04-2010, 07:27 AM   #4
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7
Posts: 874

Rep: Reputation: 113Reputation: 113
I think I might have your fix. Do this

Quote:
sudo visudo
and look for this line
Quote:
# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=NOPASSWD: ALL
Its pretty self explanatory.

Just put a # in from of %sudo ALL=NOPASSWD: ALL

should look like this
Quote:
# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
#%sudo ALL=NOPASSWD: ALL
Good luck to you.

Last edited by jmc1987; 09-04-2010 at 07:29 AM. Reason: had to fix an error
 
Old 09-04-2010, 07:35 AM   #5
urgrue
LQ Newbie
 
Registered: Aug 2010
Location: Belgium
Distribution: RHEL, Fedora, Ubuntu
Posts: 3

Rep: Reputation: 0
Quote:
Originally Posted by jmc1987 View Post
Just put a # in from of %sudo ALL=NOPASSWD: ALL
This also means he can't sudo at all, which can be inconvenient.
If you still want sudo to work, but to prompt for a password, just remove the NOPASSWD: part (so its just %sudo ALL=(ALL) ALL).
 
Old 09-04-2010, 07:43 AM   #6
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7
Posts: 874

Rep: Reputation: 113Reputation: 113
No he can still sudo. This is default with ubuntu

Quote:
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
This is my /etc/sudoers and I use my pass when I sudo. I have been using ubuntu 9.04 as my desktop late
 
  


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
How does on login as the root ? And what password do I use for it ? vigdavies Linux - Newbie 28 10-17-2009 08:53 PM
Password Recovery in Edubuntu 7.04 - In Terminal, Root Login : su , password : ????? farhannaeem13 Linux - Security 3 11-30-2007 10:59 AM
How to set login and password and root password in suse 10.2 sirius57 SUSE / openSUSE 8 07-24-2007 10:51 AM
root login password barrythai Ubuntu 1 12-25-2006 01:26 PM
ROOT LOGIN OK, su password NOT OK Darrell_Thomas_ Linux - Security 3 10-19-2004 03:32 PM


All times are GMT -5. The time now is 06:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration