Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Changing Password for Newly Created User

Posted on 2008-11-19
11
Medium Priority
?
490 Views
Last Modified: 2013-12-27
Hi,

We've recently inherited a Sparc SOlaris 8 system and we need to create new users on the system. We have root access and we've tried to create the user using the following syntax:-

useradd -d /export/home/testuser -c "TestUser" testme

The User appears to have been created without any issues but then (as the root user) I try to change the password by using:-

passwd testme

but then instead of the expected "New Password:" prompt, I get the "Password:" prompt which suggests that either the user hasn't been created properly or I can't for some reason change the password for the user.

I tried to login as root and then "su - testme" and this is ok but when I try to do passwd inclar again, it's still the same issue.

Anyone have any ideas on what I can check or do to create a user in this case - I tried to use the -p option in useradd but this causes a problem in creating the user. Alternativly, Is there a default password that's assigned when useradd creates the user?

Thanks

Michael
0
Comment
Question by:mikesung99
  • 5
  • 3
  • 3
11 Comments
 
LVL 8

Expert Comment

by:biztiger
ID: 22992873
0
 

Author Comment

by:mikesung99
ID: 22992967
Thanks for the links - I've checked them through and specified the User and Group ID and this seemingly lets me create the account. However, when I then try and do passwd for the newly created user I still get the "Password:" prompt instead of the "New Password" prompt.

Does this mean that the account I created isn't recognised by the system (as when I try to do passwd on a non-existent account, I get the same "Password:" prompt being rerturned). As such, how can I check to verify that the account has indeed been created proplerly? I thought that if I could "su - xx" then that means it's been created ok but am I missing somthing?



Thanks

Michael
0
 
LVL 8

Expert Comment

by:biztiger
ID: 22993256
Your account is recognized by the system.
Go on .
Create password (don't bother about new password prompt) and then test it.

Please let me know the result.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:mikesung99
ID: 22993373
Sorry I don't quie understand - can you clarify about how I would create the password?

What I've tried so far is passwd testme and I get the following results:-

System(root)# passwd tesme
Password:
passwd: Sorry, wrong passwd
Permission denied

However, I notice that if I try to change the password on a non-existent user (e.g. blahblahblah) I still get the same result (eventhough I would expect that the system will tell me that the user doesn't exist...)

System(root)# passwd blahlahblah
Password:
passwd: Sorry, wrong passwd
Permission denied

Thanks

Michael
0
 
LVL 8

Expert Comment

by:biztiger
ID: 22993472
Try to login to the newly created account using blank password.

After login type passwd on shell.

I think it will help.Also, please let me know the result.
0
 
LVL 22

Expert Comment

by:Brian Utterback
ID: 22993603
What naming service are you using? What does the passwd line of the /etc/nsswitch.conf file say? What does the do all the line that begin "passwd" or "other" say in the /etc/pam.conf file? (Actually, just check that the pam.conf file hasn't been changed. If it hasn't then we don't need to see the actual values)  Can you post the relevant lines from the /etc/passwd and /etc/shadow files?
0
 

Author Comment

by:mikesung99
ID: 22994008
I've tried to login to the newly created user with a blank password but that didn't work. I've also tried to change the password by switching users (su - testme) and the running the passwd but this just attempts to change the password for root.

Here's the info from the specific files:-

/etc/nsswitch.conf
       passwd:    files

/etc/pam.conf
        passwd  auth  required /usr/lib/security/$ISA/pam_unix.so.1

/etc/passwd
        testme:x:1010:1::/export/home/testuser:/bin/sh

/etc/shadow
        testme:*LK*:::::::

Since we inherited the system, I'm unsure if the /etc/pam.conf was changed from when Solaris was first installed.

Thanks

Michael



0
 
LVL 22

Expert Comment

by:Brian Utterback
ID: 22994116
Okay, this shows that the account does not actually have a passwd assigned, it is locked and thus the only way to login to it
is via the su as root method.

So, to fix this, run these commands:

passwd -d testuser
passwd testuser
0
 

Author Comment

by:mikesung99
ID: 22994222
I've tried the commands but I get the following output:-

System(root)# passwd -d testme
Password:
passwd: Sorry, wrong passwd
Permission denied
System(root)# passwd testme
Password:
passwd: Sorry, wrong passwd
Permission denied

It just seems that passwd always needs a password entered before you can do anything.....

Michael
0
 
LVL 22

Accepted Solution

by:
Brian Utterback earned 1500 total points
ID: 22995222
Okay, I think you have a problem with your pam.conf file. The original pam.conf file that shipped with Solaris 8 FCS did not have a line for passwd in it. Later, it was patched to add a line that looked like this:

passwd  auth required           pam_passwd_auth.so.1


So, you have a passwd line that isn't the same as this one, so you have neither.
0
 

Author Comment

by:mikesung99
ID: 22995588
Thanks for all the info - I'm still not sure what's causing this issue as I've checked on another solaris system where the pam.conf file is exactly the same in terms of the passwd parameter but that system is anle to run passwd without any problems.

I've managed to work around this issue by editing the /etc/shadow file directly and assigning the same encrypted password as for root (the password that I know). I can then log in as the user (testme) and then I can run the passwd to change the password as I now know what the password is.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question