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 02-27-2012, 01:52 AM   #1
schrodingore
LQ Newbie
 
Registered: Feb 2012
Posts: 18

Rep: Reputation: Disabled
passwd command not working in single user mode


I am going though a book trying to learn linux, one of the tasks is to change the root password by booting into single user mode.

According to what I have found after I get into single user mode I should just have to type in passwd and it should prompt me for a new password... but it doesn't. tried passwd root with the same effect, same with passwd -S and passwd -S root. Nothing seems to work

anything ya'll can think of I have over looked?

this is RH6

this does work in multi-user mode.

Last edited by schrodingore; 02-27-2012 at 01:55 AM.
 
Old 02-27-2012, 01:54 AM   #2
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
In redhat 6 you won't be able to change your root password from single user mode

try this in single user mode

Code:
#passwd -d root
this will delete your root password.
So that you can create a new password at next login for root
 
Old 02-27-2012, 02:00 AM   #3
schrodingore
LQ Newbie
 
Registered: Feb 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
that worked :-D
Thanks!!!
why would that work and not the password change?
 
Old 02-27-2012, 02:02 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello and welcome to LinuxQuestions,

How exactly did you enter single user mode? Explain in detail what you did. What's the output of
Code:
which passwd
I just tried it on a fresh install of RHEL 6.2 and it works as expected. Unless you've set up your system 'out of the ordinary' you should be able to use passwd.

Looking forward to your participation in the forums. Have fun with Linux.

Kind regards,

Eric
 
Old 02-27-2012, 02:03 AM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
I am not very sure if I can answer that correctly but in RHEL 6 it is not possible to change password using single user mode.
Even I had faced this thing and came up with the command which already posted
If you are satisfied with the solution kindly mark the thread as " solved " as it may help others
 
Old 02-27-2012, 02:04 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by deep27ak View Post
In redhat 6 you won't be able to change your root password from single user mode

try this in single user mode

Code:
#passwd -d root
this will delete your root password.
So that you can create a new password at next login for root
Hi,

Nice call, but can you elaborate a bit on why it doesn't work in RHEL 6? I just tried it on a RHEL 6.2 installation and it works as usual, just running passwd from the console in single user mode.

Kind regards,

Eric
 
Old 02-27-2012, 02:08 AM   #7
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
No sir,
As I said I am not very sure with that because I was also facing the same issue where I tried deleting the root password to give a new one.

Now I can't get back into that scenario to check the location of passwd command

I think schrodingore might help to give the location of passwd
 
Old 02-27-2012, 02:08 AM   #8
schrodingore
LQ Newbie
 
Registered: Feb 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
notabley I havn't figued out how to update it yet (still getting a "this system is not registered with RHM") so that could be my issue.

Moved from Cisco to Linux so trying to figure this stuff out :-P

Thanks again for all the help
 
Old 02-27-2012, 02:11 AM   #9
schrodingore
LQ Newbie
 
Registered: Feb 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
/etc/passwd
I think

Is this the file your looking for?
 
Old 02-27-2012, 02:13 AM   #10
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by schrodingore View Post
notabley I havn't figued out how to update it yet (still getting a "this system is not registered with RHM") so that could be my issue.

Moved from Cisco to Linux so trying to figure this stuff out :-P

Thanks again for all the help
Hi,

Without registering your system with RHN (Red Hat Network) you don't have access to updates. So first you'll have to run:
Code:
rhn_register
If you haven't paid for a subscription from Red Hat then you will not be able to update your system once the trial period is over. You should know that Red Hat is not free, so you either pay for a subscription and use their network for your updates or you change to a free clone of Red Hat, like CentOS or Scientific Linux. The fact that your system is not registered with Red Hat has nothing to do with the fact that you cannot change your root password in single user mode AFAIK.

Kind regards,

Eric
 
Old 02-27-2012, 02:13 AM   #11
schrodingore
LQ Newbie
 
Registered: Feb 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
just saw your
which passwd
line

it is in /usr/bin/passwd
 
Old 02-27-2012, 02:15 AM   #12
schrodingore
LQ Newbie
 
Registered: Feb 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
alrighty
thanks

use to windows where if something doesn't work right a few updates might fix it.
 
Old 02-27-2012, 02:16 AM   #13
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by schrodingore View Post
/etc/passwd
I think

Is this the file your looking for?
Hi,

No, that's the file that holds all the users on your system. The output of the command
Code:
which passwd
should give you
Code:
/usr/bin/passwd
Kind regards,

Eric
 
Old 02-27-2012, 02:18 AM   #14
schrodingore
LQ Newbie
 
Registered: Feb 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
it does

/usr/bin/passwd
 
Old 02-27-2012, 02:21 AM   #15
schrodingore
LQ Newbie
 
Registered: Feb 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
hmm notabley doing a
cat /usr/bin/passwd
screws up your command line :-P
 
  


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
Unable to Access to Single User Mode or Emergency Mode Pinglu Linux - Newbie 3 10-17-2011 02:25 PM
Emergency mode can mount the HDD with FS error but not in rescue or single user-mode kayod_jj Linux - Newbie 3 12-01-2010 08:03 PM
cannot change linux passwd from user mode sudarsh Linux - Software 9 09-09-2009 09:45 PM
single user mode under vxfs mode enabled. UltraSoul Solaris / OpenSolaris 1 06-27-2009 10:48 PM
Single User mode isolvesystems Linux - Newbie 5 10-03-2007 09:05 PM


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