LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-09-2008, 08:04 AM   #1
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 448

Rep: Reputation: 31
Logging in as root get "/bin/bash: Permission denied"


root@172.29.0.21's password:
Last login: Sun Jun 8 23:28:06 2008
/bin/bash: Permission denied
Connection to 172.29.0.21 closed.


I tried ssh, and direct console same results.

All the permissions look ok... not to mention I'm logging in as root. Doesn't root have full access to everything?


I can access the file system by mounting it and chroot to the mount. Any ideas what it's looking for?
 
Old 06-09-2008, 08:20 AM   #2
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Rep: Reputation: 30
This could be a number of reasons,..

1. home folder deleted
2. wrong password

...

I would suggest booting into single user mode and checking what is causing the error
 
Old 06-09-2008, 08:44 AM   #3
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by shawnbishop View Post
This could be a number of reasons,..

1. home folder deleted
2. wrong password

...

I would suggest booting into single user mode and checking what is causing the error

According to the /var/log/secure it's logging in fine. The /root folder exists with 750 and the password I did an passwd to change it. So it's definitely not that.

Went to single user mode and I'm sitting at a sh-3.1# prompt.

What do I check from here? Any other suggestions?
 
Old 06-09-2008, 09:10 AM   #4
ischi
Member
 
Registered: Apr 2008
Location: Tübingen
Distribution: Fedora 9 (Thinkpad T60), Debian 3.1 (Server)
Posts: 51

Rep: Reputation: 15
Is Root Login Via SSH enabled? There is an option to disable root Login via SSH so if this is set the root login fails and you can only login as normal user and then su to root.

/etc/ssh/sshd_config and set "PermitRootLogin" to "yes".
 
Old 06-09-2008, 09:13 AM   #5
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
What does 'ls -l /bin/bash' output?

Forrest
 
Old 06-09-2008, 09:28 AM   #6
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by ischi View Post
Is Root Login Via SSH enabled? There is an option to disable root Login via SSH so if this is set the root login fails and you can only login as normal user and then su to root.

/etc/ssh/sshd_config and set "PermitRootLogin" to "yes".


Enabled or not it wouldn't explain why I can't even log in on the console.

ls -l /bin/bash

-rwxr-xr-x 1 root root 722684 Jan 5 2007 /bin/bash
 
Old 06-09-2008, 09:43 AM   #7
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
OK, it might be your .login, .profile, or .bashrc file is having an error. Try moving the root home directory out of the way and creating a new one that is empty and see if you can log in.

HTH

Forrest
 
Old 06-09-2008, 09:52 AM   #8
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by forrestt View Post
OK, it might be your .login, .profile, or .bashrc file is having an error. Try moving the root home directory out of the way and creating a new one that is empty and see if you can log in.

HTH

Forrest
Still no luck. Did:

mv root root-bk
mkdir root


still same problem.
 
Old 06-09-2008, 10:13 AM   #9
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,506

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
You can check also the libraries on which the /bin/bash executable depends:
Code:
ldd /bin/bash
to retrieve a list of required libraries, then check if they are still in place.
 
Old 06-09-2008, 10:19 AM   #10
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by colucix View Post
You can check also the libraries on which the /bin/bash executable depends:
Code:
ldd /bin/bash
to retrieve a list of required libraries, then check if they are still in place.
did ldd.

Checked all the libraries listed and all they're symbolic links. Permissions are either 0755 or 0777
 
Old 06-09-2008, 10:30 AM   #11
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 448

Original Poster
Rep: Reputation: 31
Stop looking I found it ;)

found it. Booting the kernel with selinux=0 solved my problem.



I always forget about that stupid selinux. Most times programs say denied by firewall. selinux tends to just silently block things... (where's the beading my head against a wall emoticon... )

One of these days I'll remember to check it first. *ARRRRR!*

Thanks for all the quick responses...
 
Old 06-09-2008, 10:40 AM   #12
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
OK, then perhaps it is a permission with one of the libraries that bash is calling. The command 'ldd /bin/bash' will tell you which libraries it is using. Some of them are links that point to other links, but eventually they all point to a real file. Look at the permissions of the real files. On my system they are all 755 root:root.

Note: The file linux-gate.so isn't really a file, it is a virtual dynamically shared object (DSO) that is part of the kernel.

HTH

Forrest
 
Old 06-09-2008, 10:44 AM   #13
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
I guess I shouldn't hit submit on a post I was working on 45 minutes ago but had to put off due to working on other things without refreshing it to see if someone else already answered the question.

Oh well, at least you figured it out.

Forrest

Last edited by forrestt; 06-09-2008 at 10:46 AM.
 
Old 07-24-2014, 11:46 AM   #14
dayeliu
LQ Newbie
 
Registered: Nov 2006
Posts: 4

Rep: Reputation: 0
selinux?

@MikeyCarter, did you figure out what exact triggered SELINUX? I know this was a six years old post, but I am seeing exact same symptom on Fedora 20 after an update.

Thanks.
 
Old 07-24-2014, 11:55 AM   #15
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by dayeliu View Post
@MikeyCarter, did you figure out what exact triggered SELINUX? I know this was a six years old post, but I am seeing exact same symptom on Fedora 20 after an update.

Thanks.
Never bothered to look any further into it.
 
  


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
"bash: /dev/null: Permission denied" on Ubuntu Login... sancho Ubuntu 10 10-07-2009 11:38 PM
Permission Denied when trying as "root" to edit xorg.conf d3g@ Linux - Newbie 4 09-07-2006 05:19 PM
Only root hears sounds, alsa gives "permission denied" Baix Linux - General 4 07-02-2005 01:30 PM
Permission denied on " ls "for root user itsjvivek Linux - General 12 12-11-2002 07:02 PM
ls in /tmp produces "permission denied" even as root kpfeiffer Linux - Newbie 5 10-06-2002 12:40 PM


All times are GMT -5. The time now is 09:39 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration