Sudo Is Can Not Find Program / Path Related Issues

I am toying around with a LFS system and I am suddenly having trouble with sudo not finding binaries in the standard superuser only binary dirs (/sbin /usr/sbin). I am using sudo version 1.8.10p3. The sudoers file parses correctly and I did not modify except to allow users in the wheel group to be able use sudo to call any command. So I imaging something is wrong with the $PATH variable but I am not sure on what it is.


Similar Content



Pros And Cons Of SUDO Vs Wheel

So right now in some of my servers, some of my users are in the Wheel group and then I have some users who fall under /etc/sudoers. Don't have any consistency, however I want to change that.

I know that wheel group is legacy.

SUDO gives an audit trail I believe under /var/log/secure.

I'm wondering what others have experienced and setup which worked better in the long run, place users either in wheel group or in SUDO?

Sudo: No Valid Sudoers Sources Found, Quitting

Hello,

I am getting the follwoing error for Red Hat Enterprise Linux Server release 6.6

sudo su -
sudo: >>> /etc/sudoers: syntax error near line 118 <<<
sudo: parse error in /etc/sudoers near line 118
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

cd /etc/sudoers.d/
-bash: cd: /etc/sudoers.d/: Permission denied

Could you help me to figure it out. As a root user am able to access but as normal user it is not allowing to sudo su - command.

vi /etc/sudoers.d/access
username ALL=(ALL) NOPASSWD: ALL

Please let me know if any additional formation required.

Sudo Issue

When I place following line in /etc/sudoers
tom ALL=NOPASSWD:/sbin/service tomcat6 start

and..
# su - tom
# sudo -s
I get following message

Sorry, user tom is not allowed to execute '/bin/bash' as root on example.com

I did not understand can some make me understand why I am getting this message.


Thank you

How To Run A "sudo" Script Without Password

Hi all,
I have a script where every line needs to be prefixed with sudo.
I was advised to run it as $ sudo /path/to/file.sh

This script needs to be scheduled in crontab to run. If I run it as above, will I be prompted for a password?
Also, one of the lines in the script is;
scp -r root@rem_server:/source/dir /local/dir
Does that mean I will have to provide two passwords: one for sudo and one for root?

Thanks,

Executable Not Found From /usr/local/bin

Hi,

I installed ghostscript via yum package manager. Later I wanted a newer version of ghostscript and compiled it from source. "make install" placed the gs executable file under /usr/local/bin/gs. This works if I run the command with absolute path, but if try to run gs, the shell will output

"-bash: /usr/bin/gs: No such file or directory"

if I echo the path variable it will display

/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin

If i run whereis it will give me the correct path
gs: /usr/local/bin/gs

How do I make it work so that typing "gs" will run the executable file from the /usr/local/bin/gs?

(I am using Centos 6)

Thanks.

Why Should I Always Use Chmod When Not As A Root User

System Info:

I have normal user in CentOS 7 whose name is "mostafa" (the name of the account).

I naturally have another user called root with all privileges. User "mostafa" is put into sudoers file, too.

The OS is installed in VmWare, so the system is all mine.

Problem:

Now I create a file with touch file.sh and put a command in it, but when I want to run it with Code:
sudo ./file.sh

, an error is shown that the command Code:
./file.sh

does not exist. But if I Code:
 sudo chmod 777 ./file.sh

then it gets run. My question is that, why should I use Code:
chmod 777

when I myself have created the file, and I am in sudoers.

Can anyone explain me why shuold I still use Code:
sudo chmod 777

when the creator of the file is me.

Write Permissions To External Drive

I have an external disk but I can only write to it using sudo, not as my normal user.

The commands I've issued a
Code:
sudo mkdir /media/USBSSD
sudo mount -t auto /dev/sda1 /media/USBSSD
sudo chmod 777 /media/USBSSD
sudo mkdir /media/USBSSD/share

How can I set it up so that other users can write to it?

How To Convert Iso File To Burn To USB (don't Even Know How To Mount)

I'm a total total noob who is trying to download Linux Mint on a Mac OS X using a USB drive. I know there is some way to go into terminal and convert the iso file but I don't know how.

Here's the things I have tried so far: 1. sudo dd bs=4M if=[linuxmint-17.1-cinnamon-64bit.iso] of=/dev/disk2s1 (result: dd: bs: illegal numeric value)

~/path/to/Users/[my name]/linuxmint-17.1-cinnamon-64bit.img ~/path/to/Users/[my name]/linuxmint-17.1-cinnamon-64bit.iso -bash: /Users/[my name]/path/to/Users/[my name]/linuxmint-17.1-cinnamon-64bit.img (result: No such file or directory)
Maybe for #1 the "/dev/disk2s1" part is wrong? How do I find the number for the USB that goes after "dev/sd"? (I can only find "dev/disk2s1").

I have also tried to just mount/unmount the USB and drag the iso file into source/destination, to no avail.

Thanks so much!

Checking Version Of Ns2 Installed Ubuntu 12.04

i installed ns2 using following 4 commands
sudo apt-get update
sudo apt-get install ns2
sudo apt-get install nam
sudo apt-get install tcl
sudo apt-get install xgraph

on ubuntu 12.04

but how to know that which version of ns2 is installed???????

How Can I Get My Simple Script Working

hi guys,

sick of typing sudo yum install package

so i wrote...or rather am trying to right a simple script to do this
with a simple command:

heres what i have:

#!/bin/bash
echo "Enter package name to install..."
read $P
sudo yum install $P

it doesnt seem to want to take the variable...it just runs
sudo yum install ...$p is ignored...i also tried "$p" but this
doesnt work either...what is the correct syntax to get a command to read a variable...is this possible...aaaaaaah it must be.