List of questions
Related questions
Question 335 - XK0-005 discussion
A systems administrator is creating new user accounts on several Linux machines and wants to automate the process from a Linux system used for operations. In this operations system, the list of servers is located in the /home/user/serverslist file and the list of user accounts is located in the /home/user/userslist file. Which of the following scripts will help accomplish this task?
bash for server in $(cat /home/user/serverslist) do for user in $(cat /home/user/userslist) do sudo useradd $user done done
bash for server in $(cat /home/user/serverslist) do ssh -i user@$server 'for user in $(cat /home/user/userslist) do sudo useradd $user done; exit' done
bash for server in $(cat /home/user/serverslist) do scp /home/user/userslist user@$server:/tmp ssh -i user@$server 'for user in $(cat /tmp/userslist) do sudo useradd $user done; exit' done
bash ssh user@$(cat /home/user/serverslist) 'sudo useradd $(cat /home/user/userslist); exit'
0 comments
Leave a comment first