LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Cannot execute /bin/sh: Permission denied (https://www.linuxquestions.org/questions/slackware-14/cannot-execute-bin-sh-permission-denied-675103/)

ItsJustLoco 10-08-2008 02:23 PM

Cannot execute /bin/sh: Permission denied
 
Hi.

i've got a big problem with my slackware installation. I'm using it for a long time right now and tried to update it via ssh like many times before.

Now, the update was successfull. Just some packages could not be updated because of depencies, but these were not so necessary packets like pidgin. Now after the updating the connection was lost and when I tried to start it again the answer from my machine was: "Cannot execute /bin/sh: Permission denied".

When I came home I tried to login but the same error message came up. This only happens with an user-acct. The root acct. is working perfectly, but I don't like it very much to surf and do everything on my root acct. :P

I checked the permissions of / and they are set to 755 like it has to be. Also all files (but links of course) in /bin are set to 755.

Does anybody have an idea what may be the problem?

Thanks in advance.

gmorris 10-08-2008 02:34 PM

That's bizarre. I haven't been at it for a while myself, and find the permissions a little confusing sometimes too. If you haven't already, I'd check for all links to bash or any bash-<version##-##.##> types of files and make sure they aren't linked, as well as the same for all sh-<version> or anything like that you can find. I've seen some install programs change links on things and just mess the whole thing up. Other than that, I don't have a clue what it could be.

ItsJustLoco 10-08-2008 03:30 PM

Unfortunately, that's not the problem. :( But thanks for your answer.

Shade 10-08-2008 03:59 PM

A user on a mailing list I'm on recently posted with this problem. They solved it and had this to say about their solution:

Quote:

Thanks. But problem solved. Insufficient permissions on newly installed
libraries from glibc package.

Go through the files installed by the latest glibc package and make sure they're readable and executable by all.

raconteur 10-08-2008 04:08 PM

That message can also appear on the local machine when the ssh keys for the user on the remote machine don't match the last recorded attempt.

To avoid any confusion, when I say local machine, I mean the machine where you are invoking ssh, and the remote machine is the machine you wish to connect to via ssh.

On the remote machine, try editing $HOME/.ssh/known_hosts (where $HOME is the user account's home) and find the line corresponding to the IP of the remote machine, and delete that line.

ssh should then prompt you (on the local machine) for adding a unique key on the remote machine for that IP.

Something else to look at, but probably hasn't changed since the update -- check that the sshd process is running (though I believe the message on the local machine would be different in that case).

ItsJustLoco 10-08-2008 04:29 PM

Thanks raconteur, but I have the same problem here. I'm at the not working computer right now.

Shade, is it only the file libc in /lib and /usr/lib?

---------------------------------------------------
Folder /lib

-rwxr-xr-x 1 root root 1528742 2007-06-19 22:57 libc-2.5.so
-rwx------ 1 root root 1570593 2008-10-08 10:32 libc-2.7.so
lrwxrwxrwx 1 root root 11 2008-10-08 10:32 libc.so.6 -> libc-2.7.so

the 700 at libc-2.7.so may be the problem, am i right? But it's the same for all other packages:

-rwxr-xr-x 1 root root 25250 2007-06-19 22:57 libcrypt-2.5.so
-rwx------ 1 root root 42592 2008-10-08 10:32 libcrypt-2.7.so
lrwxrwxrwx 1 root root 15 2008-10-08 10:32 libcrypt.so.1 -> libcrypt-2.7.so

Do I have to change all these rights?
---------------------------------------------------

In /usr/lib it looks like this:

-rw-r--r-- 1 root root 2969776 2008-10-07 01:32 libc.a
-rwxr-xr-x 1 root root 238 2008-10-07 01:23 libc.so
-rw-r--r-- 1 root root 15946 2008-10-07 01:32 libc_nonshared.a
-rw-r--r-- 1 root root 3047916 2008-10-07 01:33 libc_p.a

Also the same like for the other files in here:

-rwxr-xr-x 1 root root 1043 2008-09-18 06:22 libcairo.la
lrwxrwxrwx 1 root root 18 2008-10-08 10:28 libcairo.so -> libcairo.so.2.17.5
lrwxrwxrwx 1 root root 18 2008-10-08 10:28 libcairo.so.2 -> libcairo.so.2.17.5
-rwxr-xr-x 1 root root 392456 2008-09-18 06:22 libcairo.so.2.17.5

---------------------------------------------------

But it seems that the problem on the mailing list is the same one like mine, since it started exactly after the update.

Thanks for your help

keefaz 10-08-2008 07:10 PM

Yes, reset the permissions would fix the problem
If you have a doubt about a file permission, check the MANIFEST file, available in your install disk or at one of the Slackware mirrors in: http://www.slackware.com/getslack/

Woodsman 10-09-2008 12:16 AM

My memory is fuzzy tonight, but I seem to recall that the error message you received will also occur:

1. If the shell script you are trying to run was created and saved in Windows/DOS and contains separate line feeds and carriage returns.

2. You are trying to run the script from a FAT32 partition, which provides no support for file permissions.

ItsJustLoco 10-09-2008 04:28 AM

Thanks Woodman, interesting point. I'm not using FAT oder Windows/DOS in anyway, but good to know. :)

Keefaz, thank you for the tip with the manifest-file. It was the problem. While I was updating, it changed the new libs to 700 instead off 755. I changed them back to 755 and now it is working again.

Thank you very much for your help.


All times are GMT -5. The time now is 12:31 PM.