| | |
Escaping Encrypted password strings
Thread Solved |
•
•
Join Date: May 2004
Posts: 10
Reputation:
Solved Threads: 0
I'm trying to add users via a script using the following command.
The result is that I am only getting a portion of the encrypted password
in the /etc/shadow file. I've tried lots of variations on using ' hard quotes with no luck.
Any help? Thanks.
USER=newuser
PASSWD=`openssl passwd -1 $USER`
echo $PASSWD returns
$1$2DIVvhnL$5aSr5G1O17cQXdG8HshOu.
CMD="useradd -p `openssl passwd -1 $USER` $USER"
or
CMD="useradd -p $PASSWD $USER"
results in the following in /etc/shadow:
newuser
IVvhnLaSr5G1O17cQXdG8HshOu.:13656:0:99999:7:::
The $1$2 portion of the passwd has been dropped. If there are other special characters in the password string, such as $ or / then the password gets truncated at those points as well.
I've tried variations like
PASSWD=`openssl passwd -1 $USER`
CMD="useradd -p $PASSWD $USER"
CMD="useradd -p ${PASSWD} $USER"
etc.
Thanks
Andrew
The result is that I am only getting a portion of the encrypted password
in the /etc/shadow file. I've tried lots of variations on using ' hard quotes with no luck.
Any help? Thanks.
USER=newuser
PASSWD=`openssl passwd -1 $USER`
echo $PASSWD returns
$1$2DIVvhnL$5aSr5G1O17cQXdG8HshOu.
CMD="useradd -p `openssl passwd -1 $USER` $USER"
or
CMD="useradd -p $PASSWD $USER"
results in the following in /etc/shadow:
newuser
IVvhnLaSr5G1O17cQXdG8HshOu.:13656:0:99999:7:::The $1$2 portion of the passwd has been dropped. If there are other special characters in the password string, such as $ or / then the password gets truncated at those points as well.
I've tried variations like
PASSWD=`openssl passwd -1 $USER`
CMD="useradd -p $PASSWD $USER"
CMD="useradd -p ${PASSWD} $USER"
etc.
Thanks
Andrew
![]() |
Similar Threads
- Password (Visual Basic 4 / 5 / 6)
- password removal (Windows NT / 2000 / XP)
- password protecting (HTML and CSS)
- Need help to encrypt and decrypt password in VB (Visual Basic 4 / 5 / 6)
Other Threads in the IT Professionals' Lounge Forum
- Previous Thread: Computer Applications... [?]
- Next Thread: Any open source contributor here?
| Thread Tools | Search this Thread |
Tag cloud for IT Professionals' Lounge
1gbit advertising advice amazon answers archive british broadband business businessprocesses career carrier censorship cern china cio collectiveintelligence connectivity consumer consumers corporateearnings css datatransfer debtcollectors dictionary digg digital ebay ecommerce email employment environment facebook food government grid high-definition hottub infodelivery infotech intel internet interview ipod isp japan kindle lhc library malware marketing mit moonfruit news onlineshopping php piracy piratebay pope porn program questions r&d religion remoteworking research retail security sex shopping simple skype smallbusiness smb sms socialmedia socialnetworking software softwareengineer spam speed spending startrek statistics stumbleupon survey tabletpc technology touch-screen touchscreen training twitter uk vbulletin videoinprint voips web webdesign windows words





