editing files with script

hi guys,

We have to implement new local (/etc/default/login) USER security policy on almost 50 stations.
so editing /etc/default/login and /etc/default/passwd will be way too long work.
Can we do the same using some script, I mean editing the above files and putting variables as RETRIES=3, DISABLETIME=60, TIMEOUT=30 etc etc.

Thank you for the assistance.

@Asteroid.

if the files on all servers are the same, write the new file ONCE and copy them to the other servers. if you need to edit the files have a look at the command "ed". all of this can be done in a script...

Are all the 50 stations are of the same OS version?

yes, all the stations are with same OS release

I'd copy your new /etc/default/login to at least one other test host first - ensure that the new changes will allow you to continue to maintain the host. This can be troublesome if you are unable to login to the host after you've pushed it out to all 50...

for host in `cat hostlist`; do ssh $host cp -p /etc/default/login /etc/default/login.original; scp /path_to_source/login $host:/etc/default/login; done

Yes, better be safe than sorry :smiley: