LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   can't login with root user from network (https://www.linuxquestions.org/questions/linux-security-4/cant-login-with-root-user-from-network-4175482022/)

Ujio 10-24-2013 11:50 AM

can't login with root user from network
 
Hello

I could not login with root user from network. Console login is not problem, it's working

I could login with any user from network but could not switch to root user.

I checked /etc/ssh/sshd_config. PermitRootLogin --> yes

How can I fix that ?

thanks for your helps
Ujio

pingu 10-24-2013 11:54 AM

We need to know more.
What distro are you running, do you use PAM, how do you try to switch to root - 'sudo' or 'su'?
If 'sudo' then user must be allowed to use sudo.

Ujio 10-24-2013 01:53 PM

Hello again

Distro is RHEL 6.x and running in vmware environment. VMWARE admin created this vm from physical server with vmware conversion tools.
I am using "su -", "su - root" for user switching not sudo, sudo is working very well

I did not setup for PAM. Actually I just take over this machine from hosting company. So the other company configured it with current setup.
If you help me for PAM I will check it and return with more information.

Thanks for your helps
Ujio

pingu 10-24-2013 02:04 PM

You said:
"I could login with any user from network but could not switch to root user."
But now you say
"I am using "su -", "su - root" for user switching not sudo, sudo is working very well"
So which is it, can you switch to root once logged in or not?
Normally you don't allow root login over network, always log in as user then switch to root.

Ujio 10-24-2013 02:13 PM

I could login from network with standart user and then tried to switch root user with "su -" or "su - root" but both of them fails.
I think it's more clear now :)

Actually I think if sshd_config file has following entry "PermitRootLogin yes" I could login with root user from network but it's not working. I think there is another setup

Thanks for your helps
Ujio

pingu 10-24-2013 02:38 PM

Quote:

Originally Posted by Ujio (Post 5051680)
I could login from network with standart user and then tried to switch root user with "su -" or "su - root" but both of them fails.

This sounds like root account is disabled - but you said in first post console login works? That is as root then?
Can you do 'sudo -i'?
Quote:

Actually I think if sshd_config file has following entry "PermitRootLogin yes" I could login with root user from network but it's not working. I think there is another setup
Yes there are other ways to control who is allowed to login, PAM is one.
My very first suggestion is to *not* try to allow root login via ssh, it's a security issue.
But if you really want to do that:
* Check /etc/ssh/sshd_config for directives "DenyUsers" "AllowUsers" "UsePAM yes/no"
* If PAM is used, check /etc/pam.d/sshd

Ujio 10-24-2013 02:47 PM

Hello again

root account is working, not disabled. I could login with root user from vm console like standart console and then I could work as root

/etc/ssh/sshd_config has not any line DenyUsers and AllowUsers but I don't remember UsePAM directive ( I don't have remote connection ). So I will check PAM issues tomorrow and then inform you

Please keep in touch

Thanks for your helps
Ujio

unSpawn 10-24-2013 05:52 PM

Quote:

Originally Posted by Ujio (Post 5051596)
I could not login with root user from network.

..and it shouldn't take three or more responses to tell you that you should not do that. Ensure you can log in as unprivileged user and then use Sudo or su.


Quote:

Originally Posted by Ujio (Post 5051596)
Console login is not problem, it's working

Then check the logs for clues.

Ujio 10-30-2013 03:15 AM

Hello again

Sorry for delayment :(

There was UsePAM yes directive in sshd_config file so I modified it as "UsePAM no" and then restarted sshd daemon. But no progress, still could not login with root user through network.

I pasted sshd_config file into following lines (removed the lines that starts with #)
Quote:

Protocol 2
SyslogFacility AUTHPRIV
PermitRootLogin yes
PasswordAuthentication yes
ChallengeResponseAuthentication no
GSSAPIAuthentication yes
GSSAPICleanupCredentials yes
UsePAM no
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Subsystem sftp /usr/libexec/openssh/sftp-server
So, where is the problem ?

Thanks
Ujio

Ujio 10-30-2013 09:52 AM

Hello

Rebooted server and then it's working now
I don't understand how reboot operation helped to issue.

Thanks for your helps

ncmoody 11-03-2013 11:32 AM

Many Deamons do not monitor their config files, to to effect any changes from editing these files, so if you do not start and stop the Deamons manually then a reboot will do it for you.

As said else where there are security problems with using root remotely, seriously consider undoing what you have done and also hardening your system to allow root access ONLY via the console. It may be a pain but could save you from a lot more pain.

Ujio 11-05-2013 03:27 AM

Hello

I have to say, I have enough HPUX, Solaris, Linux, FreeBSD administration experiences in production environments.
I have not got any bad issue like that.

I configured many ssh daemons in many environments. I have not needed to reboot my server for any ssh configuration problem. According to my experiences, if UNIX OS kernel does not recommend me for reboot, I don't need reboot.
Stoping and starting daemon must be enough normally. I am thinking it must be bug/patch problem, Linux distro a little bit older release, customer insisting about this release because of the application specific req.

Thanks for your inputs
Ujio


All times are GMT -5. The time now is 09:15 PM.