LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-24-2013, 11:50 AM   #1
Ujio
LQ Newbie
 
Registered: Sep 2011
Posts: 17

Rep: Reputation: Disabled
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
 
Old 10-24-2013, 11:54 AM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
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.
 
Old 10-24-2013, 01:53 PM   #3
Ujio
LQ Newbie
 
Registered: Sep 2011
Posts: 17

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-24-2013, 02:04 PM   #4
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
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.
 
Old 10-24-2013, 02:13 PM   #5
Ujio
LQ Newbie
 
Registered: Sep 2011
Posts: 17

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-24-2013, 02:38 PM   #6
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Quote:
Originally Posted by Ujio View Post
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
 
Old 10-24-2013, 02:47 PM   #7
Ujio
LQ Newbie
 
Registered: Sep 2011
Posts: 17

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-24-2013, 05:52 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Ujio View Post
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 View Post
Console login is not problem, it's working
Then check the logs for clues.
 
Old 10-30-2013, 03:15 AM   #9
Ujio
LQ Newbie
 
Registered: Sep 2011
Posts: 17

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-30-2013, 09:52 AM   #10
Ujio
LQ Newbie
 
Registered: Sep 2011
Posts: 17

Original Poster
Rep: Reputation: Disabled
Hello

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

Thanks for your helps
 
Old 11-03-2013, 11:32 AM   #11
ncmoody
Member
 
Registered: Feb 2013
Location: Worcester, UK
Distribution: lots, mainly Xubuntu
Posts: 78

Rep: Reputation: Disabled
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.
 
Old 11-05-2013, 03:27 AM   #12
Ujio
LQ Newbie
 
Registered: Sep 2011
Posts: 17

Original Poster
Rep: Reputation: Disabled
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
su: Authentication failure for root user even login wright user passwd jsaravana87 Linux - Server 1 02-09-2012 11:36 AM
Adding root privaliges to user accounts or auto login as root Val-Ent Linux - General 15 03-02-2010 04:27 PM
Gnome: Cannot login as default user, sends back to login, works as root Danny-T Linux - Newbie 2 05-27-2006 03:44 AM
I have re-installed MK 9.2 but cannot login as user, login as root works. bobinglis Mandriva 2 02-22-2004 11:39 AM
can only login as root? user login doesnt work..? anyone? hacking_4_b33r Linux - General 1 02-05-2004 11:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration