LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

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

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


Hi
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' xx@gmail.com


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
NsrW9L
passwd: unrecognized option '--stdin'
Usage: passwd [options] [LOGIN]


Regards
arun

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

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

Code:
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.
 
  


Reply


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


All times are GMT -5. The time now is 09:34 AM.

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