LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 01-31-2015, 09:34 PM   #1
kmcleod
LQ Newbie
 
Registered: Jan 2015
Location: Rockford, IL
Distribution: Ubuntu 14, CentOs 7, OpenSuse, Ubuntu Server
Posts: 9

Rep: Reputation: Disabled
Cannot get root to work


I have been getting permission denied issues when trying to log into as root. I have set my password and when I type su - root and enter in my password I keep getting either password incorrect when I know I am typing it in correctly or acess permission denied from su. Can anyone explain what I am doing wrong. I am trying to get into /etc/passwd for homework assignment and I get permission denied when logged in as my user. Any help will be great. I have in the past been able to logg in to root but now I cant seem to get into it. This is a new install of ubuntu 14
 
Old 01-31-2015, 09:44 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,367
Blog Entries: 12

Rep: Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752
What distro are you using? Some distros--Ubuntu and its derivatives, in particular--disable the root login by default and want you to use the sudo command.
 
Old 01-31-2015, 09:54 PM   #3
kmcleod
LQ Newbie
 
Registered: Jan 2015
Location: Rockford, IL
Distribution: Ubuntu 14, CentOs 7, OpenSuse, Ubuntu Server
Posts: 9

Original Poster
Rep: Reputation: Disabled
Cannot get root to work

Frank I am using Ubuntu desktop newest verion of 14. I am admin on my computer and I set the root unix/linux password and then typed it in correctly but still keep getting invaild password or no permission for su command

Kevin
 
Old 01-31-2015, 10:03 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,367
Blog Entries: 12

Rep: Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752
In that case, I have no idea what the problem might be (it might have been nice to include the additional detail in your original post so I wouldn't have wasted your time).

Has the password previously worked?

If it were me, I'd test like this: sudo su to root, then reset the password to something simple for testing purposes. If su then worked, I'd reset the password back to something complex and test again.
 
Old 01-31-2015, 10:10 PM   #5
kmcleod
LQ Newbie
 
Registered: Jan 2015
Location: Rockford, IL
Distribution: Ubuntu 14, CentOs 7, OpenSuse, Ubuntu Server
Posts: 9

Original Poster
Rep: Reputation: Disabled
Frank

First I want to thank you for taking your time to answer my questions and apologie for not including this first. When I setup root I tried it and it did work so I am stumped as to why it,s not working. Thank you for attempting to answer my question.

K
 
Old 01-31-2015, 10:37 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,367
Blog Entries: 12

Rep: Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752
No worries. This is truly puzzling; I certainly want to know how it turns out.

Passwords are hashed in /etc/shadow, but you might try catting it and /etc/passwd to see whether the files look okay.

Are you still able to sudo? If so, I'd be inclined to recommend resetting the root password for testing purposes, but I'll admit I've not had to deal with this particular problem first-hand.
 
Old 01-31-2015, 10:53 PM   #7
kmcleod
LQ Newbie
 
Registered: Jan 2015
Location: Rockford, IL
Distribution: Ubuntu 14, CentOs 7, OpenSuse, Ubuntu Server
Posts: 9

Original Poster
Rep: Reputation: Disabled
Yeah I am not able to get into /etc/passwd/ or /etc/shadow/ as I get the you do not have permission. Sudo does not work for me either. I will post her if I figure out what is going on. If I need to I will reset the password for root again and create a new password. I reused the same password the last time this evening when resetting root password, so this might be part of the issue but again I am slowly typing in the password and still get invalid password. I have done this several times where it goes 3 attempts have been made and su - root command then no longer works and sudo no longer works. I then close out the terminal and try again with a new terminal. This could be part of the issue.

K
 
Old 01-31-2015, 11:02 PM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,968

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
/etc/passwd should be world-readable. It's just /etc/shadow that needs to be restricted. If you can't get to /etc/passwd, then post what you get from
Code:
ls -ldn / /etc /etc/passwd
 
Old 01-31-2015, 11:10 PM   #9
kmcleod
LQ Newbie
 
Registered: Jan 2015
Location: Rockford, IL
Distribution: Ubuntu 14, CentOs 7, OpenSuse, Ubuntu Server
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks this worked but again from earleir post I have to get into /etc/shadow/ for user and group permission for a homework assignment and to do this I have to be in root. I'm almost tempted to wipe this computer and atart all over again. Before I do this I will create a ubuntu desktop in virtualbox and see if I can get it to work there.

K
 
Old 01-31-2015, 11:21 PM   #10
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,276

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Note that there's no trailing slash - the files are /etc/passwd and /etc/shadow (because they're files, not directories).

What do the following command show?

Code:
sudo getent passwd root
sudo getent shadow root
After you try to login you might also look at /var/log/auth.log to see if there are any log messages that might indicate why authentication failed.
 
Old 01-31-2015, 11:36 PM   #11
kmcleod
LQ Newbie
 
Registered: Jan 2015
Location: Rockford, IL
Distribution: Ubuntu 14, CentOs 7, OpenSuse, Ubuntu Server
Posts: 9

Original Poster
Rep: Reputation: Disabled
sudo getent passwd root makes the ask for password and when I trie to enter the password I get invalid password each time. When I try the /var/log/auth.log I get permission denied.

Completly confused with this. LOading a ubuntu desktop on VB and going to see if I get the same issues. If I don't I am just going to wipe the laptop and start again all over. I don't have any files saved on this machine and all of my othe distros needed are on another laptop as VB machines.

K
 
Old 01-31-2015, 11:50 PM   #12
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,367
Blog Entries: 12

Rep: Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752
Quote:
sudo getent passwd root makes the ask for password and when I trie to enter the password I get invalid password each time
What happens when you

Code:
getent passwd root
as user?

I just entered that as user on Slackware and got this:

Code:
~/ $ getent passwd root
root:x:0:0::/root:/bin/bash
Afterthought:

If sudo doesn't work any more and you have no valuable files in this install, I'm inclined to think that reinstalling is going to end up the best option. Sometimes you have to stop fishing and cut bait, but it would be nice to know what went wrong.

Last edited by frankbell; 01-31-2015 at 11:55 PM.
 
Old 02-01-2015, 12:10 AM   #13
kmcleod
LQ Newbie
 
Registered: Jan 2015
Location: Rockford, IL
Distribution: Ubuntu 14, CentOs 7, OpenSuse, Ubuntu Server
Posts: 9

Original Poster
Rep: Reputation: Disabled
To All that have offered help I now have root working. I created a new password for root and type sudo su - and I get into root but without haveing to type in the root passwd so I'm confused by that but at least I can do my homework and because messing with the shadow files can be a bad idea. I think I will work on this with my VB machine of ubuntu.

K
 
Old 02-01-2015, 12:17 AM   #14
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,385

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by frankbell View Post
but it would be nice to know what went wrong.
User error.
 
Old 02-01-2015, 12:23 AM   #15
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,367
Blog Entries: 12

Rep: Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752
Glad you got it fixed and thanks for the update!

As an aside, I think a post containing only the words "user error" is a bit harsh; it does not contribute to answering a Linux Question.

We all make user errors; that's why there is a CTRL-Z.

Making mistakes is how we learn. I congratulate OP for being dogged enough to fix this and learn from it.

Last edited by frankbell; 02-01-2015 at 01:28 AM. Reason: Politeness.
 
  


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
sudo ls /root/* does not work figure20012 Linux - Newbie 4 12-27-2012 08:12 AM
[SOLVED] Arg! Virtual machine, sudo won't work, can't log in as root, visudo won't work Arg! edpatterson Linux - Newbie 2 01-03-2012 06:33 PM
Scanner to work as USER and not forced as ROOT Root (Suse 9.1) 1kyle Linux - Hardware 0 07-10-2004 09:51 AM
IntelliMouse thumb buttons work as root, broken as non-root user, wheel works always digital vortex Linux - Hardware 7 03-02-2004 05:14 PM
got ALSA to work in root, need help getting it to work in my user profile ic3 Slackware 2 11-28-2003 11:32 PM


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