1834827 Members
2289 Online
110070 Solutions
New Discussion

User account removal

 
tap
New Member

User account removal

Hi all,
What is the quickest way to remove user account from multiple servers at a same time? We create account on trusted server and then push it to all the other server some time there are over thirty or forty servers the new account is pushed to, but when comes time to remove the accounts I have to go on each server to remove them.
That take ages any help in this matter will be greatly appreciated
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: User account removal

Shalom,

ssh-keygen -t dsa for root on the master server.

This will create a file called .ssh/id_dsa.pub

This file needs to be distributed to each server as .ssh/authorized_keys or added to the existing authorized keys file.

Secure Shell form HP-UX must be installed. http://software.hp.com

make a list of servers called list

while read -r server
do
ssh $server userdel $user
done < list

This will do it all without prompting for passwords.

A better option would be doing authentication via LDAP or NIS.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
tap
New Member

Re: User account removal

It worked
thx Steven
tap
New Member

Re: User account removal

Points awarded