Solaris 11Oracle SolarisSolaris 11.3Solaris 11.4

How to enable SSH login for root user in Solaris 11

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.

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
sshd_config  PermitRootLogin
sshd_config PermitRootLogin
If ‘PermitRootLogin’ line is not present in the sshd configuration file then SSH root user login is disabled by default.

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
Restarting SSH service in Solaris
Restarting SSH service in Solaris

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
AllowUsers parameter
AllowUsers parameter

Reference Links:-

0 0 votes
Article Rating

Prashanth Nimesh

I have passed B.Tech in Computer Science and currently working as a System Administrator with over 4 years of experience in the IT field. I am also the creator of the theGeeksHub website and its main contributor.

Related Articles

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Back to top button