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


Similar Content



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 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.

Useradd Command Why 1000:1000: Group?

useradd -s /bin/bash -d /home/jaydul -m jaydul
[root@tuhin /]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0perator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
jaydul:x:1000:1000::/home/jaydul:/bin/bash
[root@tuhin /]# cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)

jaydul:x:1000:1000::/home/jaydul:/bin/bash

Why 1000:1000: Group? it will be by default will be 500:500?
I was any mistake?
jaydul:x:500:500::/home/jaydul:/bin/bash

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.

What Does Su -l Do...and Why Would You Have To Sudo It

hi guys,

saw a video where the instructor wanted to login as root

he went...

sudo su -l

i see the -l option is -l, --login
Start the shell as a login shell with an environment similar
to a real login:

but i dont understand the significance of this...why couldnt you just go
su
login

Lsof -i Issue

Hello,

I would like to use the lsof -i command without a privilege elevated user, however it doesn't work, the output is null. It does only work when I sudo it. On another server, I've got it working perfectly, without the user being root or having to use sudo (web user). How would I be able to proceed ?
Linux - Ubuntu 14.04.

Thanks.

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,

User Permitted To Run Command,execute Program As Root And After Execution, Exit Root

when a command is typed(i.e. /path/to/the/program), as a normal user, he should be able to run that command , execute that program as ROOT and log out root after the execution is completed.
Only one user should be able to do it.
Hence, I have created a new user vj and added the following command in visudo:
Code:
vj ALL=(ALL) NOPASSWD: /path/to/the/program

Now user vj will be able to typein the command.

What I need is that the program which is been called must run as if it is run by a root user,and when the program is completely executed, exit the root user.

How do I proceed?

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?

Impossible To Get Kubuntu Open On ChromeOS

Hi everyone,

I am currently a user of crouton under chromeOS. It worked "pretty" well for about two months but does not work anymore. When I open it, linux start normally but suddenly stop and give me this message:

Quote:
The following installation problem was detected
while trying to start KDE:

No write access to $HOME directory (/home/paul).

KDE is unable to start.
I already try this Code:
sudo chown -R group:user /home/user

But I can not remember group and user name.

Thanks a lot