0

I want to shut down a tomcat server. To this end I went to the bin directory of the tomcat installation and wanted to execute the shutdown.sh script, as described in the approved answer to this question:

Several ports (8005, 8080, 8009) required by Tomcat Server at localhost are already in use

I first simply tried

./shutdown.sh

I received the following error message:

-bash: ./shutdown.sh: Permission denied

So I tried the following command:

 sudo ./shutdown.sh

This gave me the following error message:

sudo: ./shutdown.sh: command not found

So how can I run the shutdown.sh script as sudo-user? What is the correct syntax?

steady_progress
  • 3,311
  • 10
  • 31
  • 62

3 Answers3

0

You should be able to run

sudo -i /path/to/executable.sh

Since the -i flag:

[Run's] login shell as the target user

AP.
  • 8,082
  • 2
  • 24
  • 33
Camden
  • 283
  • 2
  • 15
0

Try granting privileges by

chmod 755 ./shutdown.sh
Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
prsutar
  • 429
  • 2
  • 4
  • 17
0

run bellows,

sudo chmod 777 shutdown.sh
sudo ./shutdown.sh
s.jone
  • 21
  • 5