LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-28-2011, 03:32 PM   #1
miroc
LQ Newbie
 
Registered: Jun 2011
Posts: 3

Rep: Reputation: Disabled
Question newusers problem with root login


On a new installation of Linux Red Hat server, I was adding new users from the list using "newusers" command.
I did not realize that one of the users was "root" so this is what line I loaded by error (among other users) :

root:root:1176:501::/home/circuser:/bin/bash

... all other users from the list (160 of them) got loaded properly.


I still have valid root login that I could use, but I'm not able to log in as root anymore. If I log in as user and then try "su" or "su -" I get error:
": No such file or directory".

I compared /etc/passwd, group and shadow on this server with old one I'm replacing and entry for root looks the same:
root:x:0:0:root:/root:/bin/bash ( in passwd)
root:x:0: (in /etc/group)
root:$1$OILC.ETm$LkoGprgqqgv6v8oLRUBnf.:15153:0:99999:7::: (in /etc/shadow) - similar to my old server

Can anyone help?

Thanks in advance.
 
Old 06-28-2011, 03:53 PM   #2
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable, amd64
Posts: 805

Rep: Reputation: 32
edit: ignore

Last edited by qrange; 06-28-2011 at 03:57 PM.
 
Old 06-28-2011, 03:55 PM   #3
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
@ Reply

Hi there,

Let us know the output of:

ls -l /etc | grep passwd
ls -l /etc | grep shadow

Check if they are owned by root user and root private group. If they are (even if they are not) boot in single user mode and change the password for root user and then chown root.root /etc/passwd and /etc/shadow (if they are not already owned by root), reboot and then try to login with root or su - root.
 
Old 06-28-2011, 04:33 PM   #4
sandwormusmc
Member
 
Registered: Nov 2006
Distribution: Fedora 15 x86_64
Posts: 76

Rep: Reputation: 24
Quote:
Originally Posted by T3RM1NVT0R View Post
Hi there,

Let us know the output of:

ls -l /etc | grep passwd
ls -l /etc | grep shadow

Check if they are owned by root user and root private group. If they are (even if they are not) boot in single user mode and change the password for root user and then chown root.root /etc/passwd and /etc/shadow (if they are not already owned by root), reboot and then try to login with root or su - root.
Also while you're in single user mode get rid of or change the user name of the other entries named "root" in /etc/passwd. Sounds like OP learned a valuable lesson about input validation.
 
Old 06-29-2011, 12:26 PM   #5
miroc
LQ Newbie
 
Registered: Jun 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Here is ls -l /etc | grep passwd and shadow (after my attempt to su) :


-bash-3.00$ su
Password:
: No such file or directory
-bash-3.00$ ls -l /etc | grep passwd
-rw-r--r-- 1 root root 14021 Jun 28 11:23 passwd
-rw------- 1 root root 14021 Jun 28 10:58 passwd-
-rw-r--r-- 1 root root 1853 Jun 22 15:35 passwd.OLD
-bash-3.00$ ls -l /etc | grep shadow
-r-------- 1 root root 641 Jun 28 11:27 gshadow
-rw------- 1 root root 640 Jun 28 11:23 gshadow-
-r-------- 1 root root 17586 Jun 28 11:33 shadow
-rw------- 1 root root 1453 Jun 28 09:22 shadow-
 
Old 06-29-2011, 02:20 PM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
@ Reply

Permissions look ok.

Did you try changing the root password from single user mode? If yes, what was the result.
 
Old 06-29-2011, 04:13 PM   #7
miroc
LQ Newbie
 
Registered: Jun 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
I found the problem: file used in "newusers" command was DOS formatted and created extra unprintable character at the end of the line in /etc/passwd file. Removing extra characters from the end of each line in the /etc/passwd file (created by newusers command) resolved my issues.

Thank you all for your help.

Last edited by miroc; 06-29-2011 at 04:18 PM.
 
  


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
root login problem sachin gupta Linux - Newbie 6 06-30-2010 04:08 AM
Problem regarding Root login gaurishpatil Linux - Newbie 3 02-15-2008 03:02 AM
Problem with root login ibshar Linux - Newbie 2 09-26-2006 06:55 AM
Newusers command problem. Schlzm Linux - General 6 12-06-2005 10:28 AM
login root problem khebs Linux - Security 1 08-30-2005 03:10 PM


All times are GMT -5. The time now is 09:12 PM.

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