Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 09-06-2011, 12:46 AM   #1
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
error while change password in ubuntu automatically

i made a shell scripts in centos for auto password generation as below

sudo useradd -d /opt $3

passwd: unrecognized option '--stdin'

chmod -R 777 /opt

setfacl -m u:$3:rwx /opt

/etc/init.d/vsftpd restart

echo -e " Access\nftp url= ftp://$ip\nusername=$3\npassword=$passftp\ncustomername=$1" | mail -s 'Automated server scripts'

When i execute a same scripts in ubuntu lucid 10.04 version im facing error

passftp=$(</dev/urandom tr -dc A-Za-z0-9 | head -c6) ; echo $passftp upto these line its exe fine im facing error in echo $passftp | passwd --stdin $3

root@wipro-desktop:~# passftp=$(</dev/urandom tr -dc A-Za-z0-9 | head -c6) ; echo $passftp ; echo $passftp | passwd --stdin wipro
passwd: unrecognized option '--stdin'
Usage: passwd [options] [LOGIN]


Last edited by jsaravana87; 09-06-2011 at 02:28 AM.
Old 09-06-2011, 06:35 AM   #2
Senior Member
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
According to an Ubuntu forum thread, this should work:

useradd username -p `mkpasswd newpassword`
to set "username"'s password to "newpassword"; so you would use this instead of your "echo $passftp | passwd --stdin wipro". Not tested, as I have neither Ubuntu nor mkpasswd

Last edited by Snark1994; 09-08-2011 at 09:39 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: DesktopNova - Automatically Change Wallpapers On Ubuntu 11.04 (With Classic Gnome) LXer Syndicated Linux News 0 08-10-2011 12:30 PM
how to change password in ubuntu 9.10 linux.ab Linux - Newbie 1 04-04-2010 09:41 AM
How to make Ldap test user to automatically change his password after 2 days? nandanm1 Linux - Server 0 05-29-2009 12:13 PM
automatically prompt user to change password guy_ripper Linux - Security 7 01-18-2007 01:57 PM
Password Change Error dlev22 Fedora 1 06-09-2005 08:12 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:08 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration