LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training 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 08-12-2012, 04:01 PM   #1
cianz182
LQ Newbie
 
Registered: Aug 2012
Distribution: CentOS Linux release 6.0 (Final)
Posts: 5

Rep: Reputation: Disabled
Smile Trouble executing a .sh file on centos 6.1 x64 on a remote linux server.


Hi everyone,

I hope you are having a great day. I seem to be having trouble executing the shell file using the command.

I get the following message

[root@admin craftbukkit]# -bash: ./craftbukkit.sh: Permission denied

Any help would be appreciated!
Thanks!
 
Old 08-12-2012, 04:04 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,286

Rep: Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347
Show the ownerships+perms of the file.
Is it a bash file?
What EXACTLY was the cmd you used?
 
Old 08-12-2012, 04:06 PM   #3
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 7,798
Blog Entries: 11

Rep: Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103Reputation: 2103
terminal>
Code:
find `pwd` . -name craftbukkit.sh -exec ls -al {} \;
and
Code:
find `pwd` . -name craftbukkit.sh -exec head -2 {} \;
output please.
 
Old 08-12-2012, 04:07 PM   #4
cianz182
LQ Newbie
 
Registered: Aug 2012
Distribution: CentOS Linux release 6.0 (Final)
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the prompt reply Chris the permissions are listed below

[root@admin craftbukkit]# ls -l
total 11444
-rw-r--r-- 1 root root 11697717 Aug 7 07:28 craftbukkit.jar
-rw-r--r-- 1 root root 63 Aug 12 20:53 craftbukkit.sh

The command I used to run the shell script was ./craftbukkit.sh
 
Old 08-12-2012, 04:09 PM   #5
cianz182
LQ Newbie
 
Registered: Aug 2012
Distribution: CentOS Linux release 6.0 (Final)
Posts: 5

Original Poster
Rep: Reputation: Disabled
Habitual the output you requested is listed below.

[root@admin craftbukkit]# find `pwd` . -name craftbukkit.sh -exec ls -al {} \;
-rw-r--r-- 1 root root 63 Aug 12 20:53 /root/craftbukkit/craftbukkit.sh
-rw-r--r-- 1 root root 63 Aug 12 20:53 ./craftbukkit.sh
[root@admin craftbukkit]# find `pwd` . -name craftbukkit.sh -exec head -2 {} \;
#!/bin/sh
screen java -Xms1024M -Xmx1024M -jar craftbukkit.jar
#!/bin/sh
screen java -Xms1024M -Xmx1024M -jar craftbukkit.jar
 
Old 08-12-2012, 04:32 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,286

Rep: Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347
Code:
 -rw-r--r-- 1 root root 63 Aug 12 20:53 craftbukkit.sh
You have no execute perms set on that file, that's why it won't run.
Try
Code:
chmod u+x craftbukkit.sh
BTW, please use code tags https://www.linuxquestions.org/quest...do=bbcode#code
 
Old 08-12-2012, 04:36 PM   #7
cianz182
LQ Newbie
 
Registered: Aug 2012
Distribution: CentOS Linux release 6.0 (Final)
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks Chris but now I get this error

Code:
./craftbukkit.sh: line 2: screen: command not found
 
Old 08-12-2012, 04:38 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,286

Rep: Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347Reputation: 2347
Means what it says;
1. screen is not installed
OR
2. screen is not in your user's $PATH

BTW, please add you distro+version to your profile, so we can help you better eg
Code:
cat /etc/*release*
 
Old 08-12-2012, 04:44 PM   #9
cianz182
LQ Newbie
 
Registered: Aug 2012
Distribution: CentOS Linux release 6.0 (Final)
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks Chris my version is CentOS Linux release 6.0 (Final)I installed screen and it seems to work perfectly now.

Thank you very much for your help.(and patience!)

Kind Regards,
Cian
 
  


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
How to rescue the corrupted fstab file in centos 6.2 in remote server sanjay87 Linux - Server 1 07-04-2012 03:53 AM
PHP installed but not executing when in browser on CentOS server saxophonemaster Linux - Server 6 06-20-2012 11:53 PM
comparing size of directories/file of remote linux server with local linux server cnt Linux - Server 4 08-03-2011 01:33 AM
CentOS x64 VPN server trscookie Linux - Networking 7 12-27-2010 12:14 AM


All times are GMT -5. The time now is 12:06 AM.

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