LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 11-18-2014, 10:44 AM   #1
stucker1
LQ Newbie
 
Registered: Nov 2014
Posts: 5

Rep: Reputation: Disabled
Can't su to root


Running Red Hat Enterprise Linux 6.4. We have several servers. On one particular server we can't su to root. Enter password and get error: "could not open session".

I can su - (dash) to root just fine. On all of our other RHEL servers we can su to root just fine.

I have checked several forums and not found this specific problem.

Any help would be appreciate. Thanks!
 
Old 11-18-2014, 12:25 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Run "man -k securetty" and examine what you see there.

Do you have the pam_securetty enabled? Is the terminal you're doing the su from in /etc/securetty? Can you do the su if you're in a terminal session on the console but not from other terminal sessions (e.g. PuTTY) over network?

Have you verified the "su" you're running is the same as it is on the other systems (i.e. is there a wrapper script?)

From what you wrote it sounds like you're saying you have the issue on "su" and not "su -". If I have that backwards the issue may be something in the profiles (e.g. /etc/profile, $HOME/.bashrc, $HOME/.bash_profile) that root is invoking on launch that is doing it based on some test.

Make sure you compare findings on each of the above points to the systems where it is working.
 
1 members found this post helpful.
Old 11-18-2014, 04:08 PM   #3
stucker1
LQ Newbie
 
Registered: Nov 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the response. Let me see if I can answer your questions:
man -k securetty looks the same for all servers.

I am sure we have PAM enabled. I did check securetty and they look the same, but also we have "auth required pam_securetty.so" remmed out in /etc/pam.d/remote, so does this mean that we aren't using securetty?

Another really interesting thing, from the console on the Linux server (it is on a virtual machine), I now cannot log in AT ALL, as any user. No matter what user I try to log in as, even root, I get error "permission denied". This obviously used to work-we had to log into the console to install set up IP and install telnet server so we can telnet to it from other boxes. I can still telnet to the server and login as any user so with my limited knowledge I don't know why I can't log in on the console any more.

I probably have something really messed up! Thanks for the help.
 
Old 11-18-2014, 04:44 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
So from the console is it the GUI you can't login to or the command line? If you're at the GUI prompt hit "Ctrl-Alt-F2" to go to a command line terminal and see if login there fails. It may simply be your GUI console is hosed and if so you can restart it.

NOTE: Since you say it is a virtual make sure Ctrl-Alt-F2 has no meaning to whatever virtualization console you're on before you do it. (There may be a way to map it within the virtualization console itself.)
 
Old 11-18-2014, 04:47 PM   #5
stucker1
LQ Newbie
 
Registered: Nov 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
On the console it is just a command prompt. We don't use a gui.

Thanks.
 
Old 11-18-2014, 06:22 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
There is a big difference in "su " and "su - "

su -
is a shortcut for
Code:
su -l root
 
Old 11-20-2014, 02:38 PM   #7
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by John VV View Post
There is a big difference in "su " and "su - "

su -
is a shortcut for
Code:
su -l root
Yep and I'd asked the OP to verify if his issue was just "su" or "su -" suspecting it might be the latter and if so something in the profiles that is blocking. The original post seems to indicate the opposite however (i.e. he is just doing "su" and not "su -".)

Of course if that's the case it might be worthwhile to type "alias" and verify there is no alias setup for "su" but I did also ask for verification that the "su" being invoked is the same as the ones on the other systems.
 
Old 11-25-2014, 08:43 AM   #8
stucker1
LQ Newbie
 
Registered: Nov 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
I am happy to say our issue is resolved. With help from Red Hat support I discovered an errant line in /etc/pam.d/system-auth. Somehow making changes to the file added a line that looked like part of the previous line. That line caused all of our problems.

Thanks to all who responded.
 
1 members found this post helpful.
Old 11-25-2014, 02:55 PM   #9
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Glad you got it fixed. Please mark the thread as solved so that other having similar issue in future can more quickly find threads with solutions.
 
  


Reply



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
how can i write to a root:root 750 file with a non-root user? Droa Linux - Newbie 1 05-14-2012 07:49 PM
[SOLVED] how can i remount root filesystem as read/write after modify readonly-root file jcwkyl Linux - Newbie 3 12-21-2010 10:40 PM
How can I have a script owned as root and run as root by a user: setuid? stickey bit? abefroman Linux - Newbie 9 04-19-2008 05:15 PM
why lftp command run failed when user isn't root, but ok when logining as root steven_yu Linux - Software 0 06-06-2007 08:36 PM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 04:14 PM

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

All times are GMT -5. The time now is 04:57 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