LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-28-2009, 04:54 AM   #1
tulsi
Member
 
Registered: Aug 2009
Location: Chennai
Posts: 54

Rep: Reputation: 15
Modified "/etc/passwd", unable to login as root!


Hi guys,


I made mistake in /etc/passwd file(Cent OS). In the file I change root::/bin/bash to /sbin/nologin. so I cannot enter the root. but I enter the users and i tried to change /bin/bash but permission denied.

please help me. its a important and urgent one.
Thank you.
 
Old 12-28-2009, 05:13 AM   #2
zQUEz
Member
 
Registered: Jun 2007
Distribution: Fedora, RHEL, Centos
Posts: 294

Rep: Reputation: 54
Use a Linux install cd/dvd and start into rescue mode. For a Red Hat based Linux distro (e.g. CentOS), at the start prompt, type `linux rescue`. Work through the prompts until it drops you to a shell. Then edit your /etc/passwd which should be mounted under `/mnt/sysimage`.
 
Old 12-28-2009, 05:14 AM   #3
dctw
LQ Newbie
 
Registered: Oct 2009
Posts: 27

Rep: Reputation: 0
Have you tried booting up in Single User Mode?
 
Old 12-28-2009, 05:23 AM   #4
tulsi
Member
 
Registered: Aug 2009
Location: Chennai
Posts: 54

Original Poster
Rep: Reputation: 15
yes I tried but cannot enter the single user mode
becoz display like
/dev/root no such a file directory
and something
 
Old 12-28-2009, 05:31 AM   #5
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
tulsi

Label your thread title as follows:

Quote:
Modified "/etc/passwd", unable to login as root !
It will help u fetch more answers since many members do not bother to look into the threads labeled "Urgent".
 
Old 12-28-2009, 05:34 AM   #6
chanduderoyal
LQ Newbie
 
Registered: Dec 2009
Posts: 4

Rep: Reputation: 0
better to use rescue mode
 
Old 12-28-2009, 05:38 AM   #7
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
seems pretty simple...

boot up any ubuntu or debian-live cd
autologin to user desktop
open a terminal and become root

sudo su

open a file manager as root (example ubuntu)

sudo nautilus

and then edit /etc/passwd

your done
 
Old 12-28-2009, 06:50 AM   #8
tulsi
Member
 
Registered: Aug 2009
Location: Chennai
Posts: 54

Original Poster
Rep: Reputation: 15
Thanks all of you


The problem will be solved

I tried to single user mode again in grub edit menu -> then end of second line like vmlinuz .....quiet S (i enter S) then go to runlevel 1 and I change the /etc/passwd file.



Thanks for all once again
 
Old 12-28-2009, 10:53 AM   #9
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
I've fixed the thread title to make it easier to find and search for.
 
1 members found this post helpful.
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to login as user; can login as root. rksanders Debian 24 02-09-2011 08:01 AM
slack12-3rdCDROM fails to load - unable to set root passwd nra Slackware - Installation 4 12-29-2007 08:34 AM
root unable to login??? ajeetraina Linux - General 8 11-27-2007 02:39 AM
cannot login as root /etc/passwd mistake swenz Linux - Software 3 03-27-2003 08:41 AM
root login incorrect ,then passwd root,but error sunnycn Linux - Security 6 05-20-2002 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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