Jason Yu
asked on
How can I make a command only be ran by sudo permission
I have a maven server. My boss requires me to set up this "mvn" command be run by sudo. I have added the path to the command to the user's profile and can run it every this user's permission. but when I tried to run the same command with "sudo" before it. it doesn't work.
How could I make "sudo mvn" work?
[kkondi@trialserverc1 ~]$ mvn -version
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd1 4efb659418 1933e; 2014-06-17T13:51:42+00:00)
Maven home: /usr/local/apache-maven/ap ache-maven -3.2.2
Java version: 1.8.0_91, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-op enjdk-1.8. 0.91-0.b14 .10.amzn1. x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.14-24.50.amzn1.x86_64 ", arch: "amd64", family: "unix"
[kkondi@trialserverc1 ~]$ sudo mvn -version
sudo: mvn: command not found
[kkondi@trialserverc1 ~]$
my boss says below:
"if mvn is in path then..
I should be able to do sudo mvn too..
but i am not able to do it right now"
is it true with what he said?
All experts here, please kindly give a good reason to defend my point if his saying is wrong.
Thanks.
How could I make "sudo mvn" work?
[kkondi@trialserverc1 ~]$ mvn -version
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd1
Maven home: /usr/local/apache-maven/ap
Java version: 1.8.0_91, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-op
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.14-24.50.amzn1.x86_64
[kkondi@trialserverc1 ~]$ sudo mvn -version
sudo: mvn: command not found
[kkondi@trialserverc1 ~]$
my boss says below:
"if mvn is in path then..
I should be able to do sudo mvn too..
but i am not able to do it right now"
is it true with what he said?
All experts here, please kindly give a good reason to defend my point if his saying is wrong.
Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
how you added mvn to sudo?
ASKER
Omarfarid:
I don't know how to do it, but my boss asked me to do it.
Do you have any clue?
thanks.
I don't know how to do it, but my boss asked me to do it.
Do you have any clue?
thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
great, I will follow you experts advise to read the soduer manual and test this setup.
I am happy to get the solution here, have a nice weekend, all guys here.
Thanks.
I am happy to get the solution here, have a nice weekend, all guys here.
Thanks.
ASKER
great help, the advises are valuable.
ASKER