Linux System Administration l Quiz Questions and Answers

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,
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
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.
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"
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.
Answer :
  • :wq

Explanation :

Press : (colon). The cursor should reappear at the lower left corner of the screen beside a colon prompt. Type : wq or x it will save the file and exit Save a file and exit.