In this tutorial, we will learn how to enable direct root login in Solaris 11 operating system through Secure Shell (SSH).
By default when you install a fresh Solaris 11 operating system, the root user does not have SSH login access to the system. This is done for security purposes and it is a default setting. So if you want to login to your system as root user, you have to first login as a normal non-root user and then switch to root user. To remove this restriction and login directly with root user follow this tutorial.
Table of Contents
Become an administrator
Become an administrator or login as a user having Administrative rights.
$ sudo su
OR
$ su -
Take the back up of sshd_config file (optional)
First of all, before doing any changes to /etc/ssh/sshd_config file, it is recommended to take a backup of the original file. So that if you messed up with the sshd_config file then you have the original file backup to restore. It is optional step and totally up to you whether to take backup or not.
Change the PermitRootLogin parameter to yes
Please check the sshd configuration file /etc/ssh/sshd_config and change the PermitRootLogin entry to yes as shown below. If this line is not present then add it manually.
# vi /etc/ssh/sshd_config
PermitRootLogin yes
Restart SSH service
Once you have modified the sshd configuration file, restart the SSH service using svcadm command for the changes to take effect. After restarting the SSH service, check the status of service using svcs command
# svcadm restart ssh
# svcs ssh
Check for AllowUsers parameter
If the parameter AllowUsers is set as well, it is necessary to add user “root” to the AllowUsers’ list as shown below.
# vi /etc/ssh/sshd_config
AllowUsers user1 user2 root
Reference Links:-
- https://docs.oracle.com/cd/E86824_01/html/E54775/sshd-config-4.html
- https://docs.oracle.com/cd/E88353_01/html/E37852/sshd-config-5.html