PSSH command to run find users present in wheel group

pthombare

New Member
Joined
Jan 15, 2019
Messages
2
Reaction score
0
Credits
0
Hello guys ,

I want to take out wheel group users from multiple linux host with the help of pssh command.Please assist.
 


This may be a bit late to the show for this thread.. But this is fairly streight forward. My pssh commands are a bit rusty but here are my notes:



#########

How to create a set of lists and then when you want to run a command on all nodes in that group (array) then run them in parallel on cluster nodes





Documentation:

https://www.tecmint.com/execute-commands-on-multiple-linux-servers-using-pssh/


Step 1: Installation



yum install python-pip

pip install --upgrade pip

pip install pssh





Step 2: Create cluster file

vi /root/clusternodes
thor.test.local

odin.test.local

kmstr01.test.local

kmstr02.test.local

kmstr03.test.local

kproxy01.test.local

kproxy02.test.local

kproxy03.test.local

kworker01.test.local

kworker02.test.local







Step 3: Run parallel command

[root@kmstr01 ~]# pssh -h clusternodes 'uname -a'

[1] 09:06:43 [SUCCESS] thor.test.local

[2] 09:06:43 [SUCCESS] odin.test.local

[3] 09:06:43 [SUCCESS] kmstr01.test.local

[4] 09:06:43 [SUCCESS] kworker01.test.local

[5] 09:06:43 [SUCCESS] kmstr02.test.local

[6] 09:06:43 [SUCCESS] kproxy01.test.local

[7] 09:06:43 [SUCCESS] kproxy03.test.local

[8] 09:06:43 [SUCCESS] kworker02.test.local

[9] 09:06:43 [SUCCESS] kproxy02.test.local

[10] 09:06:43 [SUCCESS] kmstr03.test.local



Your command would be : Ex: remove 'bob' from wheel gpasswd -d user group


pssh -h clusternodes 'gpasswd -d bob wheel'
 

Staff online

Members online


Latest posts

Top