Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: b1ackmai1er on February 11, 2011, 10:41:01 PM
-
Hi,
I want to change my password through a script:
tried this but it didn't work. Can anyone see the mistake I am making?
tc@box:/mnt/sda1$ echo '123asimov$$$' ; echo '123asimov$$$' | sudo passwd tc
123asimov$$$
Changing password for tc
New password:
Retype password:
Passwords don't match
passwd: password for tc is unchanged
Thanks.
-
You can see an example of how I did it in /etc/init.d/tc-config using chpasswd
echo "$USER:$PASSWD" | chpasswd
-
HI that works great!
Still would be interested to know how to do this using pipes/redirectiohiln as I wish to use the same techniques for smbpasswd as well.
I saw a script somewhere that showed the password being redirected to the program from a file but cannot find it. It was not as simple as sudo smbpasswd -a user < passfile.txt
regards b1ackmai1er