Sponsored Content
Full Discussion: Messed up password
Operating Systems Linux Ubuntu Messed up password Post 302698599 by Royalist on Monday 10th of September 2012 10:12:23 AM
Old 09-10-2012
Bug

Right then Lem. Here is the latest:

Code:
roy@roy-desktop:~$ passwd -S roy
roy NP 12/15/2011 0 99999 7 -1

So the password is NOW unlocked and has been since I
Code:
cp /etc/shadow /etc/shadow.bak2

and
Code:
cp /etc/shadow.bak /etc/shadow

I presume that I can login without password because mine is the Admin account and otherwise the whole system would be inoperable?

I can confirm that there are currently NO
Code:
passwd.lock shadow.lock gshadow.lock group.lock

There may have been before the above?

NOW AFTER TAKING A BREAK

Success - I have succeeded in changing my password in root and now have access to sudo and this is how it was done!

Code:
roy@roy-desktop:~$ sudo passwd roy -S
[sudo] password for roy: 
roy P 09/10/2012 0 99999 7 -1

However, a user account is still locked.
Code:
roy@roy-desktop:~$ sudo passwd robyn -S
robyn L 12/15/2011 0 99999 7 -1
roy@roy-desktop:~$ sudo passwd robyn
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
robyn L 12/15/2011 0 99999 7 -1
roy@roy-desktop:~$ sudo passwd -u robyn
passwd: password expiry information changed.
roy@roy-desktop:~$ sudo passwd robyn -S
robyn P 09/10/2012 0 99999 7 -1

roy@roy-desktop:~$ ls -l /etc/shadow
-rw-r----- 1 roy roy 1066 2012-09-10 14:07 /etc/shadow
roy@roy-desktop:~$ ls -l /etc/shadow*
-rw-r----- 1 roy roy 1066 2012-09-10 14:07 /etc/shadow
-rw------- 1 roy roy 1066 2012-09-10 14:07 /etc/shadow-
-rw------- 1 roy roy 1002 2012-01-24 18:19 /etc/shadow-~
-rw-r----- 1 roy roy  968 2012-01-24 18:21 /etc/shadow.bak
-rw-r----- 1 roy roy 1297 2012-09-07 17:06 /etc/shadow.bak2
roy@roy-desktop:~$ ls -l /etc/passwd*
-rw-r--r-- 1 roy roy 1997 2012-09-10 14:07 /etc/passwd
-rw------- 1 roy roy 1997 2012-09-10 14:07 /etc/passwd-
roy@roy-desktop:~$ sudo chown root:root /etc/shadow*
roy@roy-desktop:~$ ls -l /etc/shadow*
-rw-r----- 1 root root 1066 2012-09-10 14:07 /etc/shadow
-rw------- 1 root root 1066 2012-09-10 14:07 /etc/shadow-
-rw------- 1 root root 1002 2012-01-24 18:19 /etc/shadow-~
-rw-r----- 1 root root  968 2012-01-24 18:21 /etc/shadow.bak
-rw-r----- 1 root root 1297 2012-09-07 17:06 /etc/shadow.bak2
roy@roy-desktop:~$ sudo chown root:root /etc/passwd
roy@roy-desktop:~$ ls -l /etc/passwd
-rw-r--r-- 1 root root 1997 2012-09-10 14:07 /etc/passwd
roy@roy-desktop:~$ sudo chown root:root /etc/passwd*
roy@roy-desktop:~$ ls -l /etc/passwd
-rw-r--r-- 1 root root 1997 2012-09-10 14:07 /etc/passwd
roy@roy-desktop:~$ ls -l /etc/passwd*
-rw-r--r-- 1 root root 1997 2012-09-10 14:07 /etc/passwd
-rw------- 1 root root 1997 2012-09-10 14:07 /etc/passwd-
roy@roy-desktop:~$ sudo chown root:shadow /etc/passwd*
roy@roy-desktop:~$ ls -l /etc/passwd*
-rw-r--r-- 1 root shadow 1997 2012-09-10 14:07 /etc/passwd
-rw------- 1 root shadow 1997 2012-09-10 14:07 /etc/passwd-

roy@roy-desktop:~$ sudo lsof /etc/passwd
[sudo] password for roy: 
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
sudo    27415 root    3r   REG    8,1     1997 3499 /etc/passwd

roy@roy-desktop:~$ grep roy /etc/shadow
grep: /etc/shadow: Permission denied
roy@roy-desktop:~$ sudo grep roy /etc/shadow
roy:$6$pbvzv3b0$EofbFYlDFAV1E6oSKYYU3U/FQiKZHqWCjlEWKWM55W2qQxGo7JjiECLjJiJ0n1y68arhGaD3vKRhCWk9YvKA10:15593:0:99999:7:::

There is still a '3r' after/under 'FD'

If you can see anything else that needs to be corrected, please let me know.

Thanks very much Lem and Jim.
SmilieSmilieSmilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how do u remove a messed up freebsd boot installation?

i messed up while installing freebsd into a dual os wannabe system. Now, how do i del it( so i wouldn't get prompted to choose freebsd during boot?)so that i could try installing a different flavour of linux? cheers:eek: (1 Reply)
Discussion started by: coffeecoolers
1 Replies

2. UNIX for Dummies Questions & Answers

Messed up tar files

I created tar files for directories using this command: tar -cvf * >tarfile what happened was I got a file tarfile with a list of the files and it took the first file in each directory and overwrote it with the actual tar file. I've been trying to figure out since yesterday what I did... (2 Replies)
Discussion started by: Barb
2 Replies

3. Shell Programming and Scripting

I think I have messed up with crontab

Hi Guy, In my system there were some cronjob were already scheduled. and somehow I want to enter one new cronjob with crontab. So I isssue crontab temp.txt. it scheduled that job but now it's showing me only this job with crontab -l. but I can not see the old cronjob list that already set up.... (2 Replies)
Discussion started by: vishalpatel03
2 Replies

4. AIX

Totally messed up

I have moved the etc/passwd file and we are now unable to get in to Unix - any suggestions? (2 Replies)
Discussion started by: vbagwell
2 Replies

5. UNIX for Dummies Questions & Answers

Can't loging because .basrc file messed up

Dear Friends, I have messed up with my .bashrc file (something I have deleted) and now i can't login back to system.. any Idea.. I can do login with other login and password.. but I dont have root password because of security reason... If I ask root then It will take about 4 -5 days to go... (4 Replies)
Discussion started by: umeshjaviya
4 Replies

6. UNIX for Dummies Questions & Answers

Messed up my boot environment or root profile

Ok, a couple weeks ago I was fixing a cron report about perl not happy with 'locale' info (LANG and LC not set). As a result, I was experimenting with setting the correct 'locale' in several areas (like /etc/sysconfig/i18n and who knows where). Somehow after a reboot, as soon as the OS starts... (3 Replies)
Discussion started by: Garball
3 Replies

7. Linux

history timestamp is messed up

Hi, Just wanted to know if anyone else has noted that the time-stamp in the history is all out of whack.:eek: I've Ubuntu, all patched, and when I ran history, it showed me commands that I ran few weeks ago with today's date. Is this normal? Here is a snippet: .... 85 2010-06-09 09:03:31... (6 Replies)
Discussion started by: nitin
6 Replies

8. UNIX for Dummies Questions & Answers

messed up path

Help!! Seem to have messed up my path, as I keep getting command not found error. Could someone please tell whats wrong or how to fix it. export PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:$PATH ---------- Post updated at 08:34 PM ---------- Previous update was at 07:50 PM ---------- ... (1 Reply)
Discussion started by: davcra
1 Replies

9. AIX

Oracle ASM accidentally messed with my hdisk

I have AIX 5.3 with oracle 10g ( test server). While trying to create RAW disk for Oracle ASM I have accidentally messed with rootvg (hdisk0 & hdisk1) When I do # lspv hdisk0 0516-066 : Physical volume is not a volume group member. Check the physical volume name specified. ... (4 Replies)
Discussion started by: George_Samaan
4 Replies

10. HP-UX

Ignite-UX INDEX file messed up, how to recreate?

OK, so I just messed myself up. Thinking the /var/opt/ignite/data/INDEX files was static, I manually edited the file and added 2 more OS's to it. During an Install it only showed the first OS (started with 11.31, 3 versions then added a 11.23, and a 11.11 stanza's). The 11.23 and 11.11 never... (2 Replies)
Discussion started by: mrmurdock
2 Replies
All times are GMT -4. The time now is 11:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy