cancel
Showing results for 
Search instead for 
Did you mean: 
Mawuena
Flight Engineer
Flight Engineer
  • 741 Views

Access denied for ssh root@RHEL9.5_IP

Hello,

I could do ssh login with any other user except root.


root@W.X.Y.Z's password:
Access denied
root@W.X.Y.Z's password:
Access denied
root@W.X.Y.Z's password:

Please, help.

5 Replies
Chetan_Tiwary_
Community Manager
Community Manager
  • 708 Views

@Mawuena You are about to learn something very important and exciting with this issue. Before that happens, I would like you to ponder over few things and think as a Linux administrator whose one of the job is to also maintain best practices and ensure security of the linux server so that it is not susceptible to brute force attacks :

  1. Why would a linux admin allow someone as privileged as Root user to login to a server over ssh ?
  2. What about the security lapse if someone like root user can login using ssh protocol ?
  3. Why would other user's ssh access works smoothly but not of Root user's ( in this case ) - Could it be deliberate ?
  4. Can we check the detailed verbose output of ssh as to what is happening during the above mentioned ssh session ?
  5. Can we check something in the logs to identify the root cause ?
  6. If you think YES is the answer to point 3 - where can I check that deliberate setting ?
  7. What would be the implications if we change that deliberate setting ?
  8. How will that change be effective ? Do we need to restart any service or any daemon ?
  9. Is there any alternate way of giving access to some user who can run privileged commands allowed explicitly ?
  10. Even if you have to allow Root login over ssh what other protection you could have ?

If you start thinking over these points I think you can understand many things as to why this is happening, how to check the cause , then to troubleshoot and implement alternative solutions. These points not only covers ssh concept but encompasses several other concepts that is part of daily job of Linux admins.

Mawuena
Flight Engineer
Flight Engineer
  • 673 Views

Thanks a lot @Chetan_Tiwary_ . I have learned more.

You are perfectly right. Especially, for cybersecurity requirements, ssh with root must not be allowed, and may even lead to a major non-conformity in audit. 

I am working in a testing environment for now before porting or migrating to live production.

I am just very curious in trying to understand why "PermitRootLogin yes" is not giving ssh root acces, and what further to do to finally give ssh root access.

ShepherdZW
Mission Specialist
Mission Specialist
  • 669 Views

sudo vi /etc/ssh/sshd_config

PermitRootLogin Yes
#Make sure the above line is available. ou can also add extra security by only allowing root login from specific trusted IP
Don't forget to restart sshd.
sudo systemctl restart sshd
Mawuena
Flight Engineer
Flight Engineer
  • 654 Views

@ShepherdZW Thanks.

As you can see from the copy of the screen below, I followed the step, but still access is denied for ssh root@192.168.14.135.

[root@node1 berag]#
[root@node1 berag]# tail -n 5 /etc/ssh/ssh_config
# update-crypto-policies(8) and ssh_config(5).
Include /etc/ssh/ssh_config.d/*.conf

PermitRootLogin yes
AllowUsers root@192.168.14.134
[root@node1 berag]#

 

 

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 667 Views

@Mawuena Root access over ssh is denied in RHEL 9 by default.

Where are you editing the setting ? Did you restart the service post that ?

how about creating a drop-in file under /etc/ssh/sshd_config.d/file.conf and mention the settings there ?

did you try generating ssh keys and copying it over to the client ?

0 Kudos
Join the discussion
You must log in to join this conversation.