Puppet Practitioner Quiz Questions and Answers

What will be the file extension if I use bzip compression utility for compression?

Answer :
  • bz2

Explanation :

Three tools for compression : -z , --gzip (tar.gz) - it will compress quickly but the size will not reduce much -j. --bzip tar.bz2 it will take more time compared to gzip but it will create small size compared to gzip) -J, --xz tar.xz (it will take long time and it will compressed to the most )

I am unable to log in to the machine using ssh. What can I do to log in?

Answer :
  • restart the ssh service on that machine
  • edit the /etc/ssh/ sshd_config con?guration ?le to allow or prohibit users logging in to the system as root. Add below and save and exit PermitRootLogin yes

Explanation :

The OpenSSH server uses the PermitRootLogin con?guration setting in the /etc/ssh/ sshd_config con?guration ?le to allow or prohibit users logging in to the system as root. PermitRootLogin yes With the PermitRootLogin parameter to yes, as it is by default,

Which command can be used to count the number of words in a text file?

Answer :
  • wc

Explanation :

wc - command helps to count the words, letters and byte counts for each file w - to see how many users logged in currently cat to display the file content ls - to list all the files in current working directory

Which command can tell me about the login details of each user, ex, login attempts, login failed?

Answer :
  • head /var/log/secure
  • head /var/log/messages

Explanation :

/var/log/messages Most syslog messages are logged here. Exceptions include messages related to authentication and email processing, scheduled job execution, and those which are purely debuggingrelated.

Which command options can be used to send manual logs to rsyslog?

Answer :
  • logger -p

Explanation :

To send a message to the rsyslog service that gets recorded in the /var/log/boot.log log ?le, execute the following logger command: [root@host ~]# logger -p local7.notice "Log entry created on host"

How to add a user into the supplementary group?

Answer :
  • usermod -aG groupname

Explanation :

The use of the -a option makes usermod function in append mode. Without -a, the user will be removed from any of their current supplementary groups that are not included in the -G option's list.