LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-19-2009, 02:30 PM   #1
jbottiger
LQ Newbie
 
Registered: Oct 2008
Location: Central FL
Posts: 21

Rep: Reputation: 0
Question Cannot su to root successfully / Cannot copy/move *.bz2 files from Sosreport


When logged in as a normal, ordinary user, I type 'su', and the system prompts me for a password. I type the password, but then the system displays the message 'Login incorrect'. I know the root password as I have been able to successfully login as root from the main login screen.

I contacted Red Hat support regarding this issue; they asked me to run "sosreport" and send them the resulting sosreport file. The Linux computer is NOT connected to the Internet; it is connected within an internal network-configured system.

Anyway, I followed the steps as written and as directed via phone support WRT running the "sosreport" command. This command generated the file "sosreport-jbottiger.1886840.tar.bz2". Tried to cp and mv the file to a thumb drive, but received an error message every time (i.e., Permission denied, even after 'chmod'ding the file to '777'). Tried changing the file name and redoing the cp and mv commands--same issue. If I mv the file to another directory on the Linux computer, it's OK; but I cannot cp the file to the same directory as I had read permission errors as noted above.

My colleague says that he has done UNIX/Linux administration for over 10 years and has never seen anything like this, including the original issue of not being able to su to root.

Please advise as to what I should do. Thanks.


J. Bottiger
 
Old 01-19-2009, 02:47 PM   #2
fbianconi
Member
 
Registered: Apr 2008
Location: argentina
Distribution: Arch
Posts: 86

Rep: Reputation: 22
Can you boot linux single?
if so, try to set root password again. with
Code:
passwd [user]
see if that works rebooting and trying again.

good luck.
 
Old 01-19-2009, 03:22 PM   #3
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Have you lost the sticky bit on /bin/su ?
 
Old 01-23-2009, 09:38 AM   #4
jbottiger
LQ Newbie
 
Registered: Oct 2008
Location: Central FL
Posts: 21

Original Poster
Rep: Reputation: 0
Sticky Bit - Parameter/Permission Settings

Quote:
Originally Posted by makuyl View Post
Have you lost the sticky bit on /bin/su ?
I believe I did. The permissions are as follows:

/bin directory: drwxr-xr-x
su file (in /bin): -rwxr-xr-x

What should the settings be ('rwt' or 'rws')?

Also, I performed the following commands as per RedHat's guidance:
  • Typed 'chmod 1777 for the /tmp dir'
  • Typed 'setenforce 0'
  • Typed 'lsattr /tmp/sosreport-myname+idno.tar.bz2'
Results as follows:
  • tmp directory: drwxrwxrwt root root
  • sosreport file: -rw------- root root
Typing the lsattr command exactly as directed yields the following message:

'lsattr: Permission denied While reading flags on /tmp/sosreport-myname+idno.tar.bz2'

Should I have the sticky bit on the tar.bz2 file as well? Please advise. Thanks.

 
Old 01-25-2009, 09:26 AM   #5
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Not on linux right now, but IIRC /bin/su is -rwsr-xr-x . "chmod u+s /bin/su" should work.
I don't know what the sosreport is, but I wouldn't put a sticky bit on anything in /tmp or any other place which is world writable.
After su-ing to root, can you copy the sosreport file?
Are you sure you have write permission to the usb drive? Type "mount" to check. Or check with creating a file on the thumbdrive with touch or whatever.
Alas, if the su problem got solved by correct /bin/su permissions, the sosreport thingy is just of academic interest.
 
Old 01-26-2009, 10:47 AM   #6
jbottiger
LQ Newbie
 
Registered: Oct 2008
Location: Central FL
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by makuyl View Post
Not on linux right now, but IIRC /bin/su is -rwsr-xr-x . "chmod u+s /bin/su" should work.
  • Performed the action "chmod 4755 /bin/su" (while logged in as root). Permissions now state "rwsr-xr-x".
  • Logged out as root, and logged in as a standard user.
  • Retried su command - still fails.

Quote:
Originally Posted by makuyl View Post
After su-ing to root, can you copy the sosreport file?
Attempted to perform copy on sosreport - stiil fails.

Any suggestions/ideas? Please advise. Thanks.
 
Old 01-26-2009, 10:55 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Quote:
Originally Posted by makuyl View Post
Not on linux right now, but IIRC /bin/su is -rwsr-xr-x . "chmod u+s /bin/su" should work.
I don't know what the sosreport is, but I wouldn't put a sticky bit on anything in /tmp or any other place which is world writable.
After su-ing to root, can you copy the sosreport file?
Are you sure you have write permission to the usb drive? Type "mount" to check. Or check with creating a file on the thumbdrive with touch or whatever.
Alas, if the su problem got solved by correct /bin/su permissions, the sosreport thingy is just of academic interest.
Actually, if you look at the /tmp directory itself, the sticky bit is set. You want the sticky bit set to prevent one user from deleting another users files. It is used when a directory is world writeable, and doesn't really have much use otherwise.

About the thumb drive, if it is mounted without the permissions you need you can either right click on an automouted icon and change this behavior in the advanced properties.

You can also change the ownership and permissions using the correct options if you manually mount the pendrive.

uid=<yourusername>,gid=<yourgroup>

Also read the man mount page. You can also use fmask and dmask as well.
 
Old 01-26-2009, 03:50 PM   #8
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
My bad, confused sticky bit and suid.
 
Old 01-26-2009, 04:20 PM   #9
Nermal
Member
 
Registered: Jan 2009
Distribution: Debian
Posts: 59
Blog Entries: 2

Rep: Reputation: 6
Do you have a "/etc/suauth" file?

If so, try "man suauth" and inspect the content of that file for a group your user needs to be a member of, maybe.
 
Old 01-26-2009, 04:27 PM   #10
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Quote:
Originally Posted by makuyl View Post
My bad, confused sticky bit and suid.
That's not too bad - it's the same bit, just different meanings if it's set for a file or a directory.

And I wonder if RHEL is now using SELinux. If so, su is, most probably, one of the highly protected (and restricted) commands.

Can you do a <ctrl>-<alt>-<F3> and log in as "root" that way?

Are you in the sudoers file, and, if so, can you use a sudo ... command to accomplish your goals?

Last edited by PTrenholme; 01-26-2009 at 04:29 PM.
 
Old 01-27-2009, 10:30 AM   #11
jbottiger
LQ Newbie
 
Registered: Oct 2008
Location: Central FL
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by PTrenholme View Post
Can you do a <ctrl>-<alt>-<F3> and log in as "root" that way?
I have not tried that; did you mean to log in as another user, and while logged in as that user perform the <CTRL>+<ALT>+<F3> command?

Quote:
Originally Posted by PTrenholme View Post
Are you in the sudoers file, and, if so, can you use a sudo ... command to accomplish your goals?
I'm not sure how I can be in the sudoers file, how I access it or where it is located. Are you stating that I need to be in the sudoers file to perform a sudo ... command? Could I use the sudo ... command from any directory?

Last edited by jbottiger; 01-27-2009 at 10:37 AM. Reason: Used wrong separators
 
Old 01-27-2009, 11:40 AM   #12
jbottiger
LQ Newbie
 
Registered: Oct 2008
Location: Central FL
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Nermal View Post
Do you have a "/etc/suauth" file?
No I don't.
 
Old 01-27-2009, 12:30 PM   #13
ozminh
Member
 
Registered: Aug 2007
Posts: 73

Rep: Reputation: 19
can your group 'su'?

check this '/etc/pam.d/su'

try 'sudo su'

config sudo command: 'visudo'

(i use RH4.)

Last edited by ozminh; 01-27-2009 at 12:33 PM.
 
Old 01-27-2009, 02:46 PM   #14
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Quote:
Originally Posted by jbottiger View Post
I have not tried that; did you mean to log in as another user, and while logged in as that user perform the <CTRL>+<ALT>+<F3> command?
Yes. On most system that will start a mintty session on tty3 where you can log in as, e.g., root and "do your thing."
Quote:
I'm not sure how I can be in the sudoers file, how I access it or where it is located. Are you stating that I need to be in the sudoers file to perform a sudo ... command? Could I use the sudo ... command from any directory?
The sudoers file is normally /etc/sudoers and it's used to control which users may run commands with root access. Once you're in the sudoers file you can, for example, try a sudo su - to start your root terminal session. As a "Catch 22," you must, of course, be logged in as root to view or change the /etc/sudoers file.
 
Old 02-03-2009, 05:13 PM   #15
jbottiger
LQ Newbie
 
Registered: Oct 2008
Location: Central FL
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ozminh View Post
can your group 'su'?

check this '/etc/pam.d/su'

try 'sudo su'
I looked at the existing su file; one of my colleagues suggested commenting out one of the lines (that requires a user to be in the pam_wheel.so file/list). Please find attached to this post "before and after" versions of the pam.d file.

etc_pam_d_su_old.txt

etc_pam_d_su_new.txt

Quote:
Originally Posted by ozminh View Post
config sudo command: 'visudo'

(i use RH4.)
I haven't tried the 'sudo su' or 'vi sudo' commands (is that what the latter command was)?

Thanks.
 
  


Reply

Tags
rhel


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
Delete/move/copy files of specific date imsajjadali Red Hat 26 11-08-2013 12:34 AM
can't copy files from root rbees Linux - Newbie 12 02-22-2008 05:22 PM
On NFS, non-root users can move/rename files belonging to root. Stuart Morrow Linux - Server 2 11-05-2007 12:12 PM
can't successfully copy dvds 5matyb5 Linux - General 1 09-20-2006 05:26 PM
how to move and copy files.... JMK Linux - Newbie 3 01-22-2004 05:57 PM


All times are GMT -5. The time now is 06:55 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration