Root user not recognizing on Solaris-10 (shadow file corruption)


 
Thread Tools Search this Thread
Operating Systems Solaris Root user not recognizing on Solaris-10 (shadow file corruption)
# 8  
Old 10-22-2019
AH....

What happens when you try to add a new user?

Can you successfully add a new user?
# 9  
Old 10-22-2019
Code:
# groupadd -g 1002 johnsp
# useradd -m -d /export/home/johnsp -u 1002 -g 1002 -s /bin/bash johnsp
64 blocks
# id -a johnsp
id: invalid user name: "johnsp"
# cat /etc/passwd | grep johnsp
johnsp:x:1002:1002::/export/home/johnsp:/bin/bash
# cat /etc/shadow | grep johnsp
johnsp:*LK*:::::::
# passwd -d johnsp
passwd: password information changed for johnsp
# cat /etc/shadow | grep johnsp
johnsp::18192::::::
#

# 10  
Old 10-22-2019
My thoughts are to find another Solaris box, and copy all the relevant password and shadow password files to your 'hosed' server; making backups before you do, and do not log out.

Make sure you know the root password of the second Solaris box.

Also, do the same for the group entries.

Of course, make backups before you do, even if that means just copying the files on the hosed server to filename.bad etc.

If you can get a single root entry working again, you can recreate the others (and issue new passwords).

Make sense?
# 11  
Old 10-23-2019
Or maybe BETTER, can you use pwconv ?

Synopsis - man pages section 1M: System Administration Commands

Code:
Description
The pwconv command creates and updates /etc/shadow with information from /etc/passwd.

pwconv relies on a special value of 'x' in the password field of /etc/passwd. This value of 'x' indicates that the password for the user is already in /etc/shadow and should not be modified.

If the /etc/shadow file does not exist, this command will create /etc/shadow with information from /etc/passwd. The command populates /etc/shadow with the user's login name, password, and password aging information. If password aging information does not exist in /etc/passwd for a given user, none will be added to /etc/shadow. However, the last changed information will always be updated.

If the /etc/shadow file does exist, the following tasks will be performed:

Entries that are in the /etc/passwd file and not in the /etc/shadow file will be added to the /etc/shadow file.

Entries that are in the /etc/shadow file and not in the /etc/passwd file will be removed from /etc/shadow.

Password attributes (for example, password and aging information) that exist in an /etc/passwd entry will be moved to the corresponding entry in /etc/shadow.

The pwconv command can only be used by the super-user.

Files
/etc/opasswd
/etc/oshadow
/etc/passwd
/etc/shadow
Attributes
See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
SUNWcsu
See Also
passwd(1), passmgmt(1M), usermod(1M), passwd(4), attributes(5)

Diagnostics
pwconv exits with one of the following values:

0
SUCCESS.

1
Permission denied.

2
Invalid command syntax.

3
Unexpected failure. Conversion not done.

4
Unexpected failure. Password file(s) missing.

5
Password file(s) busy. Try again later.

6
Bad entry in /etc/shadow file.

# 12  
Old 10-23-2019
I overwrite passwd, group from other similar server and ran pwconv, still no luck.
Tried copying /etc/shadow too, no help.
Code:
# ls -l /etc/passwd /etc/shadow /etc/group
-rw-r--r--   1 0        sys          715 Oct 22 19:54 /etc/group
-rw-r--r--   1 0        sys         1939 Oct 22 19:54 /etc/passwd
-r--------   1 0        sys          852 Oct 22 19:55 /etc/shadow
#

# 13  
Old 10-23-2019
What happens if you move your shadow files to backup (move not copy them) and run pwconv on the passwd file to create the new shadow files?
# 14  
Old 10-23-2019
Yes, I did same. Initially I copied only passwd and group file from other server and ran pwconv.
Then I copied shadow also from other server.
And yes, I moved all three files, not copied.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Solaris 10 - 'ls' green for root user only

Welcome to all. Have an issue and looking for help so hope someone is able to give me some clues. I prepared some shell scripts with coloured output to help other guys to have more automated task. Not sure if I did this but now whenever I use 'ls' command for root user every output in... (29 Replies)
Discussion started by: TiedCone
29 Replies

2. SuSE

Non root user want to see /var/log/messages - any suse equivalent of Solaris dmesg

Hi New to Suse - mainly used Solaris. In solaris dmesg will also show you contents of messages log file but in Suse Liux it doesnt appear to. I dont have root access to this Suse server, and wondering is there any other tool / utility that allows me to see the messages file contents like on... (1 Reply)
Discussion started by: frustrated1
1 Replies

3. UNIX for Advanced & Expert Users

Root and non-root user not able to delete the file

Hi!! one strange problem occurred with my RHEL 5 box. i'm having logs folder with ownership of non-root user. Created some files with root user under logs folder. here is the scene: -rw-r----- 1 root root 1048227 Feb 28 12:34 SystemOut_13.02.28_12.34.10.log -rw-r----- 1 root root ... (6 Replies)
Discussion started by: sukhdip
6 Replies

4. Solaris

Solaris :regarding /etc/shadow file

what does the last column in /etc/shadow file indicate?? i read man page,it tells its FLAG..but i am not able to understand exactly why its there :confused: thanks in advance, shekhar (4 Replies)
Discussion started by: shekhar_4_u
4 Replies

5. Solaris

Solaris 9 not recognizing CDROM drive

Hello, I've read many posts that offer tips on how to mount a CDROM but I haven't seen any on how to get the system to recognize the CDROM drive. I was transferring files from CDROM to the hard drive successfully. I entered the third CDROM and the system refused to automount it. I tried... (2 Replies)
Discussion started by: TrueSon
2 Replies

6. Solaris

Enable FTP for root user in Solaris 10

I am not able to get ftp working for Solaris 10 for root user. I am getting login failed error. 331 Password required for root. Password: 530 Login incorrect. Login failed. Tried following things already. 1. SFTP works ok, still would like to know why FTP is not working (curious). 2.... (5 Replies)
Discussion started by: webkid
5 Replies

7. Solaris

Solaris not recognizing RAID 5 disks

I've just installed Sol 10 Update 9 on a Sun 4140 server and have a RAID 1 configuration (2 136 Gb drives) for the OS and have created a RAID 5 array (6 136 GB) drives. When i log into the system I am unable to see the RAID 5 disks at all. I've tried using the devfsadm command but no luck and... (9 Replies)
Discussion started by: goose25
9 Replies

8. Solaris

Non-root user access to privileged ports-Solaris 8

Please let me know how to setup a non-root user to be able to access a privileged port (<1024) on Solaris 8. I am currently running tomcat as "tomcat" user and I get the following error during to start up: SEVERE: Error initializing endpoint java.net.BindException: Permission denied<null>:443 (5 Replies)
Discussion started by: pingmeback
5 Replies

9. Solaris

How to start CDE for non root user on Solaris 10

Hi, How can I start CDE for non root user created.For root CDE is working fine but for non root user CDE exits back to login screen after trying for some time.Also I cant see .dt and .dtprofile files in the users home directory.How can I create them.Kindly help. Thanks & Regards, Kiran. (1 Reply)
Discussion started by: kiranherekar
1 Replies

10. Solaris

Permissions for the root user on Solaris 10

Hi I have a doubt, here if a file does not have the write permissions to the root user my script is going to write the data into that file. when i executed the script as root user. Is it correct ... ? (4 Replies)
Discussion started by: Shreedhar Naik
4 Replies
Login or Register to Ask a Question