To enable/allow root login from SSH you must complete the following three steps after ensuring that you really want to enable root ssh access.
- Change PermitRootLogin from no to yes in: /etc/ssh/sshd_config
(you will need super user access to edit this file.) - Restart SSHD: /lib/svc/method/sshd restart
———————————————————————————–
After fresh Install of Solaris OS , You will not be able to login directly as root with Putty as its disabled.
To enable the same follow below steps.
===============================================================================================================
1) Login as oracle/any other user from putty and follow from point 3) to enable direct root login.
OR
2) Login as root from GUI console and follow from point 3) to enable direct root login.
3) Switch user to root
-bash-3.00$ su –
Password:
Oracle Corporation SunOS 5.10 Generic Patch January 2005
# ls -ltr /etc/default/login
-r–r–r– 1 root sys 2258 Aug 6 2010 /etc/default/login
# cp -pr /etc/default/login /etc/default/login.old
#
# ls -ltr /etc/default/login*
-r–r–r– 1 root sys 2258 Aug 6 2010 /etc/default/login.old
-r–r–r– 1 root sys 2258 Aug 6 2010 /etc/default/login
#
Comment the below parameter
=============================
vi /etc/default/login
#CONSOLE=/dev/console
backup the file /etc/ssh/sshd_config
======================================
# ls -ltr /etc/ssh/sshd_config
-rw-r–r– 1 root sys 5025 Aug 6 2010 /etc/ssh/sshd_config
#
cp -pr /etc/ssh/sshd_config /etc/ssh/sshd_config.old
# ls -ltr /etc/ssh/sshd_config*
-rw-r–r– 1 root sys 5025 Aug 6 2010 /etc/ssh/sshd_config.old
-rw-r–r– 1 root sys 5025 Aug 6 2010 /etc/ssh/sshd_config
#
Change the below parameter from “no” to “yes” as below
======================================================
vi /etc/ssh/sshd_config
#PermitRootLogin no
PermitRootLogin yes
Restart ssh service
===========================================
svcadm restart ssh
************************* End of task *************************
Comments
Tags: Allow root SSH login for Solaris 10, Enable direct root Logins, Enable direct root Logins for Solaris 10, Enable direct root Logins for Solaris 10 or Allow root SSH login for Solaris 10, Linux commands, root SSH login for Solaris 10, SSH login for Solaris 10
But when you fresh installed Solaris 11 box – and you can’t login directly as root because it is a role…
db04 console login: root
Password:
Roles can not login directly
To change this, then you need to make root a user instead of being a role
Login as an administrator account and su to root
melam@sscadb04:~$ su – root
Password:
Jan 25 13:27:29 sscadb04 su: ‘su root’ succeeded for melam on /dev/console
Oracle Corporation SunOS 5.11 11.0 September 2012
root@db04:~#
As you can see in the configuration file root is a role
root@db04:~# cat /etc/user_attr
#
# The system provided entries are stored in different files
# under “/etc/user_attr.d”. They should not be copied to this file.
#
# Only local changes should be stored in this file.
# This line should be kept in this file or it will be overwritten.
#
root::::type=role
melam::::type=normal;lock_after_retries=no;profiles=System Administrator;roles=root
To change it
root@db04:~# rolemod -K type=normal root
Restart the Services.
#svcadm restart svc:/network/ssh:default
5.Try SSH connection using root user You should be able to connect.
And Voila, your system is now less secure and auditable 😉