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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-08-2006, 09:46 AM
|
#1
|
Member
Registered: Jul 2006
Posts: 102
Rep:
|
cannot execute bash: permission denied
hi...i get the above error when i try to login as root...which as you can imagine is really not very good!!
my .bash_profile is also not the same..it almost has nothing in it...about 3 lines..thats it.
ive chmod 755 for the .bash_profile and .bashrc files...and checked lib and bin and they r all ok... even the /bin/bash has 755 mode.
any ideas?
|
|
|
08-08-2006, 10:00 AM
|
#2
|
Senior Member
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596
Rep:
|
the $PATH is probably bad. Try setting it correctly in .bashrc
|
|
|
08-08-2006, 11:10 AM
|
#3
|
Member
Registered: Jul 2006
Posts: 102
Original Poster
Rep:
|
ok..i'm not sure exactly how to..
i checked PATH with echo...and it gave a long line of /sr/bin:/usr/sbin ...
within .bashrc..i dont know if there is a PATH..
could you gimme some more details.
|
|
|
08-08-2006, 11:51 AM
|
#4
|
Member
Registered: May 2006
Posts: 69
Rep:
|
As a normal user, try to determine where the binary is for bash with
That command will return the path to the version of bash that you use as a normal user.
Then, as root
Check to see if this path includes the path to bash you found earlier. If it doesn't, your root's path is bad and you should add the path to your bash binary to your path.
|
|
|
08-08-2006, 12:03 PM
|
#5
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
Quote:
Originally Posted by Agrouf
the $PATH is probably bad. Try setting it correctly in .bashrc
|
I think the path should be set in /etc/profile or maybe in .bash_profile but not in .bashrc.
(bashrc is not read on login shells)
Quote:
if [ "`id -u`" -eq 0 ]; then
PATH="/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
fi
|
Last edited by nx5000; 08-08-2006 at 12:04 PM.
|
|
|
08-08-2006, 12:05 PM
|
#6
|
Senior Member
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596
Rep:
|
^
|
that is true.
|
|
|
08-08-2006, 01:00 PM
|
#7
|
Member
Registered: Jul 2006
Posts: 102
Original Poster
Rep:
|
i tried that..
when i put which bash...it said /bin/bash
so i added /bin: to the front of my PATH in the etc/profile file as well as the .bash_profile file.
Still not being allowed.
|
|
|
08-08-2006, 01:14 PM
|
#8
|
Member
Registered: May 2006
Posts: 69
Rep:
|
Have you checked the permissions on /bin/bash?
Try this:
Please post the result of this command.
|
|
|
08-08-2006, 01:16 PM
|
#9
|
Member
Registered: Jul 2006
Posts: 102
Original Poster
Rep:
|
ya...ive chmoded just about everything to 755
|
|
|
08-08-2006, 01:57 PM
|
#10
|
Member
Registered: May 2006
Posts: 69
Rep:
|
This may not fix your current problem, but you probably don't want a binary to be writable by anyone, not even root, since that allows the binary to become corrupt.
You'd probably be better off changing the permissions of /bin/bash to 555.
Also, what are the permissions on /bin, the directory?
Try
|
|
|
08-08-2006, 03:25 PM
|
#11
|
Member
Registered: Jul 2006
Posts: 102
Original Poster
Rep:
|
yeah...theyre all executable by all and readable by all...
i think i just overly messed up..playing too much in root..
think ill just re-install.
thanks for you help. good stuff
|
|
|
11-12-2007, 10:49 AM
|
#12
|
Member
Registered: Oct 2003
Location: Tucson
Distribution: Fedora, RHEL, Ubuntu
Posts: 225
Rep:
|
Had this same exact issue. Turns out the /etc dir was 700 so chmod to 755 and everything was fine.
Hope this helps someone out!
Chris
|
|
|
All times are GMT -5. The time now is 05:18 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|