RHEL: Allowing users to ’su’ to "root" / Allowing ’root’ to login directly to the system using ’ssh’

RHEL: Allowing users to 'su' to "root" / Allowing 'root' to login directly to the system using 'ssh'

# Tested on RHEL 5, 6 & 7


# Allowing users to "su" to 'root'
# ------------------------------------------------------------------------------------------

# On a secured server regular users are not allowed to become 'root' by issuing "su" command

# /etc/pam.d/su file usually limits users that can become 'root' to those belonging to
# 'wheel' group

# This way, to allow a user to become 'root' it should be added to 'wheel' group:

usermod -g wheel <username>


# To allow all users to become super user (root), comment out following line in
# /etc/pam.d/su file (if line is uncommented only 'wheel' users will be able to do it):

   auth            required        pam_wheel.so use_uid

# To allow users in 'wheel' group to become 'root' without providing a password uncomment
# following line in /etc/pam.d/su file

   #auth           sufficient      pam_wheel.so trust use_uid


# State of these two lines can be combined in order to have one or other behaviour



# Allowing 'root' to login directly to the system via ssh
# ------------------------------------------------------------------------------------------

# Usually, after a fresh installation, 'root' is not able to login to the system via "ssh"
# To allow, verify/modify following files as necessary

# sshd_config: If existing, change "PermitRootLogin no" to "PermitRootLogin yes"

vi /etc/ssh/sshd_config
[...]
   PermitRootLogin yes
[...]

# This change requires a restart of sshd daemon:

# RHEL 5/6:service sshd restart

# RHEL 7: systemctl restart sshd



# access.conf: Change "-: root : ALL" to "+: root : ALL"

vi /etc/security/access.conf
[...]
   +: root : ALL
[...]


# Take into account that modifying this options can compromise the security of a system.
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
How To: Linux Hard Disk Encryption With LUKS [ cryptsetup Command ]
Viewed 8436 times since Fri, Jul 13, 2018
Super Grub2 Disk
Viewed 4268 times since Wed, May 22, 2019
RHCS6: Luci - the cluster management console
Viewed 4150 times since Sun, Jun 3, 2018
RHEL: Getting/Setting hardware clock’s time
Viewed 4344 times since Sat, Jun 2, 2018
OpenSSL: Check SSL Certificate Expiration Date and More
Viewed 8278 times since Mon, Feb 18, 2019
15 Linux Yum Command Examples – Install, Uninstall, Update Packages
Viewed 4599 times since Thu, Oct 25, 2018
Deskshare TLS over Stunnel
Viewed 3551 times since Fri, Sep 28, 2018
10 Linux cryptsetup Examples for LUKS Key Management (How to Add, Remove, Change, Reset LUKS encryption Key)
Viewed 7029 times since Tue, Jul 31, 2018
Fix rpmdb: Thread died in Berkeley DB library
Viewed 22148 times since Fri, Feb 14, 2020
How to Register and Enable Red Hat Subscription, Repositories and Updates for RHEL 7.0 Server
Viewed 15973 times since Mon, Oct 29, 2018