- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- passwd passing from script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2005 04:09 PM
тАО10-20-2005 04:09 PM
Any idea on passing password of a user through script.
username=Vijay
if user is already created than ...
inside the script i am checking for the user,
if the user exists, than i want to pass the passwd to the user.
Any idea on how to pass the passwd to users in script. I have heard of except(don't want to use it) but was looking for some mechanism which can allow passing of password to passwd command through pipe or something like so in the script.
With best regards,
Vijay
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2005 04:20 PM
тАО10-20-2005 04:20 PM
Re: passwd passing from script
if this is for an automated ftp or something, together with being a horrendous security risk, you can use .netrc (see man pages for more info), but the best way is to use ssh/scp with trusted public/private key pairs between hosts.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2005 04:21 PM
тАО10-20-2005 04:21 PM
SolutionCheck user and exists, you can doone of the following.
1. User /usr/sam/lbin/usermod.sam -p "pass_word" -F "user_name"
-p option requires a encrypted password. so you can do as follows. the pass needs to be of 8 chars+2salt chars.
/usr/sam/lbin/usermod.sam -p $(echo "test123te"|/usr/lbin/makekey) user_name
Password will be test1234
2. Use expect tool
3. Replace the user password feild with sed/perl/awk etc. In any case, backup up the passwd file first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2005 08:05 PM
тАО10-20-2005 08:05 PM
Re: passwd passing from script
Yes this was the type of solution I was looking for ...
Thank you very much ... and you deserve a total 10 points for this ...
With warm regards,
Vijay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2005 08:12 PM
тАО10-20-2005 08:12 PM
Re: passwd passing from script
id ${user} 1>/dev/null 2>&1
if [[ ${?} -eq 0 ]]
then
fi
You can use expect scripting to send passwd / sudo for local users also.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2005 08:20 PM
тАО10-20-2005 08:20 PM
Re: passwd passing from script
http://www.modperl.com/perl_networking/sample/ch6.html
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2005 08:26 PM
тАО10-20-2005 08:26 PM
Re: passwd passing from script
(
sleep 1
echo "muthu" # Telnet Account name
sleep 1
echo "muthu" # Telnet Passwd
sleep 1
echo "passwd muthu" # Passwd execution
sleep 1
echo "muthu" # Old Password
sleep 1
echo "muthu12" # New password. Use two alphanumeric character
sleep 1
echo "muthu12" # Confirm Passwd.
sleep 1
echo "exit 1" # Log out
) | telnet
# hostname to localhost if you are trying for local machine
Change sleep time based on system response.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2005 09:20 PM
тАО10-20-2005 09:20 PM
Re: passwd passing from script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2005 09:33 PM
тАО10-20-2005 09:33 PM
Re: passwd passing from script
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2005 10:19 PM
тАО10-20-2005 10:19 PM
Re: passwd passing from script
Anyway's in future i will take care ...
sorry for the inconvinence ...