LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-14-2018, 08:34 PM   #16
irissun
LQ Newbie
 
Registered: Oct 2018
Posts: 8

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by pan64 View Post
I would say root has no right to use sudo, but probably I missed something.
as root there is no need to use sudo.
Yes, root is no need to use sudo normally.
The issue is that the "sudo" is in a script. The script will be ran by root and also some other non-root user sometimes.
The current issue is that when root ran the script, it failed in the "sudo" part, in that specific machine, while it works fine in my lab. I want to check and know what kind of configurations in that machine caused that.
 
Old 10-16-2018, 01:00 AM   #17
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
please do the following starting as normal user:
Code:
cd /tmp
touch asdf
ls -al
lsattr
rm asdf
sudo rm asdf
su -
cd /tmp
touch asdf
ls -al
lsattr
sudo rm asdf
one could probably expand that test; we just need to get a better picture of what's going on here.
_______________________________

Quote:
Originally Posted by irissun View Post
Yes, but changed a little to remove machine specific stuff.
have you also carefully compared versions of sudo, and differences in the sudoers files, and lastly permissions of the end result?
i'm pretty sure sudo will balk if sudoers doesn't have the exact right permissions.

fwiw, on my system it's:
Code:
-r--r----- 1 root root 3.2K May 17 07:18 /etc/sudoers
__________________________________

btw, i'm with one of the previous posters: if you're already root, you don't need sudo.
Quote:
Originally Posted by irissun View Post
The issue is that the "sudo" is in a script. The script will be ran by root and also some other non-root user sometimes.
you can script that, too: check the current user id, and don't use sudo if it's 0.

Last edited by ondoho; 10-16-2018 at 01:02 AM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] apparmor="DENIED" operation="rename_src" profile="/usr/bin/freshclam Toadman Linux - Software 4 06-27-2018 08:52 AM
"creating symbolic link" "operation not permitted" wheni Linux - Newbie 3 05-08-2011 01:36 AM
Logged in as "root"/Fedora 8 but get "Operation not permitted" when using "chmod etc gosunlee Linux - Newbie 7 02-10-2008 05:56 AM
"Operation not permitted" error logging in to Ubuntu Dapper Drake paulBottomley Linux - Newbie 7 08-10-2006 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:25 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