Question
How do I enable debug logging for SSHD (SSH)?
Answer
Note: The management and maintenance of configurations for services that cPanel does not create or provide, such as SSHD, are best handled by a systems administrator with the skills, training, and expertise required to do so for you.
- Log in to the server as the
rootuser via SSH or the WHM Terminal. Make a backup of the existing configuration with the following command:
# cp -v /etc/ssh/sshd_config{,$(date +.%Y-%b-%d-%H-%M-%S)}
Open the configuration with a text editor of your choice:
CONFIG_TEXT: /etc/ssh/sshd_config
Add the following configuration to the file:
CONFIG_TEXT: LogLevel DEBUG3
Carefully inspect the configuration to see if any duplicate LogLevel directives existed before your addition. If there is another configuration already present, comment it out by placing a hash symbol (#) at the start of the line:
CONFIG_TEXT: #LogLevel INFO
Restart the SSH Daemon (SSHD) with the following command to load the new configuration:
# /scripts/restartsrv_sshd --restart
The logs for SSHD can be reviewed with one of the following commands:
# less /var/log/secure
# journalctl -u sshd
Comments
0 comments
Article is closed for comments.