- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Help on Change ROOT password on several server...
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
тАО04-14-2009 08:53 AM
тАО04-14-2009 08:53 AM
Help on Change ROOT password on several servers using script.
I need to change ROOT and user password on several servers. Does anyone have any good scripts to do this task?
I have some "sed" commands but did not help me much.
Appreciate your help in advance.
Thanks,
MJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 09:37 AM
тАО04-14-2009 09:37 AM
Re: Help on Change ROOT password on several servers using script.
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1297956
otherwise you'll need "expect", Perl's "expect" module, or something similar, as you can't redirect keyboard input to the std. passwd command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 10:02 AM
тАО04-14-2009 10:02 AM
Re: Help on Change ROOT password on several servers using script.
I need to do this on several servers and I have this sed string.
sed -e 's/^root:.*:0:/root:XyrAgtyI,N.uT:0:/' /etc/passwd
I need help on scripting this one using the server list I have. What I am trying to do is put this in FOR loop and change ROOT or any user password on all the servers.
Thanks in advance.
Thanks - MJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 11:13 AM
тАО04-14-2009 11:13 AM
Re: Help on Change ROOT password on several servers using script.
how do you intend to access the other servers? remsh, rexec, ssh batch or ???? (ssh batch is preferred) what do you have available to you.
btw: take a look at this thread, as it's in a similar vein:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1331882
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2009 12:02 AM
тАО04-15-2009 12:02 AM
Re: Help on Change ROOT password on several servers using script.
the * in root's password field can mean that user root is locked, but it can also mean you are working on a trusted system with a shadow password file. You must not write directly to /etc/passwd in that case.
Regards,
Bart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2009 04:19 AM
тАО04-15-2009 04:19 AM
Re: Help on Change ROOT password on several servers using script.
if you want to have same password on all the machine.
Download and install expect script on any one of the Servers.
Let me know if you want any help.
http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.43/
Cheers!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 07:39 AM
тАО04-16-2009 07:39 AM
Re: Help on Change ROOT password on several servers using script.
Thanks for the feedback. The password file is different on all the servers and we will access these servers from one location using ssh.
Basically, I have a "for loop" but my problem is not able to put this script format.
Appreciate your help.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 07:45 AM
тАО04-16-2009 07:45 AM
Re: Help on Change ROOT password on several servers using script.
Do I install "expect" pkg on one server that I am pushing things and sshing from OR this pkg has to be install on all the servers?
Appreciate your help.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 09:16 AM
тАО04-16-2009 09:16 AM
Re: Help on Change ROOT password on several servers using script.
Is this a one time task ? though I dont have any ready made scripts I am sure you should be a able to figure out a way if you spend enough i am saying this as scripting approch differece from person to person and we need to know what exactly you are trying to do.
If this is gonna be something which u will be doing regualrly I would advice you to use tools like "gpg"
-uvk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 10:18 AM
тАО04-16-2009 10:18 AM
Re: Help on Change ROOT password on several servers using script.
What is "GPG" is that a paid product? Anyway this what I am trying to do.
This is something we have to do every 90 days, part of the security. What I am trying to do is as below. I have the command, I want to copy the password file before the change and then make my change. That way I don't screw things up.
I was thinking using "FOR LOOP" process, something like this and I need suggestion from ITRC GURU's to make this process better. Not sure if this is going to work for me or not but I am trying.
================================
for X in $(cat server.list)
do
ssh ${X} "cp -p /etc/passwd /etc.passwd.${X}.ORIG"
sleep 4
ssh ${X} "sed -e 's/^root:.*:0:/root:hcROzuCGGBmPI,N.uT:0:/' /etc/passwd > /tmp/passwd.${X}.new"
sleep 4
done
====================
>> Verify the password file and then copy back on to each node.
Thanks in advance and appreciate everyone's help.