LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 04-24-2005, 04:32 PM   #1
nitrousoxide82
Member
 
Registered: Apr 2005
Location: Rio de Janeiro, Brazil
Distribution: Ubuntu 9.04 (Jaunty), Arch Linux 2009.08
Posts: 83

Rep: Reputation: 17
Can't run shell scripts even as root


I'm getting a "Permission denied" message whenever I try to run a shell script, even logged in as root. The exact message: "/bin/sh: Bad interpreter - Permission denied". That should never happen if I'm root. Another related problem I'm having is that I'm unable to log into anything other than the login shell, with any user; for example, if I "lock screen" in KDE, when I'm trying to unlock it it asks for my password, but fails even if I provide the correct password. The su command does the same thing - fails even when I provide the correct password. The passwd command is working only for root (it locks up the terminal if I run it as a normal user). No X-based terminal emulator (konsole, xterm, kterm) will work, possibly for the same reason.

Looking at the contents of /var/log/auth.log after yet another failed attempt of using the 'su' command I found the following:
Code:
unix_chkpwd: check pass, user unknown
su: pam_authenticate: Authentication failure
It does really look like I have a problem with the authentication system. But, how do I get rid of it?

Thanks in advance.
 
Old 04-24-2005, 04:40 PM   #2
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
Are the shell scripts executable (chmod +x)?
 
Old 04-24-2005, 04:47 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Where you try to execute a script could cause this problem.

Some partitions have the noexec option. Such as /tmp or /var. Any parition that is world writeable should be mounted with the noexec, nodev, and nosuid options.

Also, look at the first line of the scripts. Do they start with the line: #!/bin/bash
or
#!/bin/sh

I saw the exact message when I tried to execute an install script on cdrom. Sometimes prepending 'sh ' or '/bin/bash ' before the command to execute will work.
 
  


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
can echo be used for popups in shell scripts run by cron? dr_zayus69 Linux - Software 4 04-12-2005 06:30 PM
Shell scripts: gain root access - how? ludeKing Programming 16 09-02-2004 10:35 PM
Can't run shell scripts I write? JustinCoyan Slackware 2 08-06-2004 12:50 PM
How to? Run Shell scripts jmr0311 Mandriva 2 07-14-2004 09:24 PM
how can i run a shell scripts (or a number of commands )when a user logs in to a linu rddreamz Programming 4 05-20-2004 03:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:15 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
Open Source Consulting | Domain Registration