Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am new in Linux environment and I would like to know if rwx access on Linux file system can substitute sudo access to run a command.

i.e.: I have the command abcd in /etc/init.d/ and I do have rwx access for /etc/init.d/ directory and its contents. Do I need have sudo access to execute the command abcd (user@server:/>sudo abcd) or I can type only user@server:/>abcd at the command prompt?

share|improve this question
3  
Just because you have permission to execute a file, doesn't mean you will have permission to do what the script does. –  jordanm Dec 21 '12 at 17:07
add comment

1 Answer

Running abcd directly and via sudo are completely different things (assuming you're not root to begin with).

The permissions on the file will allow you to execute it as yourself, i.e. without extended privileges.
Running that program via sudo will run it with root privileges.

Whether running it directly will actually do what you want depends on the program. But keep in mind that generally, the result will not be the same at all.

share|improve this answer
    
I got it. Running as myself (without privileges) I can get error if the command calls for any data or other command outside the main folder. Correct? –  Emerson Ivo Dec 21 '12 at 17:14
1  
You'll get problems whenever the command you started needs to access resources (of any type) that you user can't. –  Mat Dec 21 '12 at 17:17
    
One lest question: May I inform all syntaxes available to cofigure SUDO or it doesn't matter running commands through SUDO? –  Emerson Ivo Dec 21 '12 at 17:25
1  
I don't understand your comment. Running things with sudo should be done only when they require to be run as root. sudo access must be limited as much as possible for normal users. –  Mat Dec 21 '12 at 17:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.