cancel
Showing results for 
Search instead for 
Did you mean: 

Script to change ndmp passwords

Vman
Level 2
I was hoping someone could help me create a script that would change the set_ndmp_attr -auth <filer_name> passwords on several filers using a script the would receive a file of the new password and input that into the script to change the passwords for all of our ndmp root accounts. I'm very new at this, but any help would be greatly appreciated.
 
The script would work like this:
start script
input new password
input hostname of filer
loop through all filers via list while changing password using the set_ndmp_attr -auth command
show successful changes
end
 
Thanks for any help
Vince


Message Edited by Vman on 05-12-2008 08:30 PM

Message Edited by Vman on 05-12-2008 08:33 PM
3 REPLIES 3

zippy
Level 6
not sure why you would do this.
 
the ndmp user on the filer has to be changed using the filers commands.
 
set_ndmp_attr -auth <filer_name> is straight forward and has to be only done when you mess with the filers password

Omar_Villa
Level 6
Employee
you can try something like this
 
1. create a file (filerpass) with the filer, user and password columns, i.e:
 
filer1 user1 password1
filer2 user2 password1
...
filerN userN passowrdN
 
2. run this:
 
for LINE in `cat filerpass`
{
    FILER='print $LINE | awk '{print $1}'`
    USER=`print $LINE | awk '{print $2}'`
    PASSWORD=`print $LINE | awk '{print $3}'`
   
    set_ndmp_attr -auth $FILER $USER $PASSWORD
}
 
 
I just did it on the fly without test, but is very near what you need.
 
regards

Vman
Level 2
Thanks Omar,
This is a great start. We have a requirement to change our passwords every three months, so this will save me a lot of time.
Cheers,
Vince