LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-28-2015, 07:42 AM   #1
nitsss
LQ Newbie
 
Registered: Dec 2015
Posts: 7

Rep: Reputation: Disabled
Unhappy Admin is not allowed to run sudo on localhost. This incident will be reported.


hi all,

i am facing the issue with sudo commands, as i have added myself into sudoers. but now this error is occuring.
Admin is not allowed to run sudo on localhost. This incident will be reported.

thnxs in advance.


nitsss
 
Old 12-28-2015, 08:22 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,989

Rep: Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250
Admin does not need sudo, if he has uid 0.Try
Quote:
ls -n
on admion's home dir. Reading the output from the left, it's
permissions 9all the drwx- stuff), inodes, uid, gid, etc.

Someont with root permission will have entries like
Quote:
bash# ls -n
drwxr-xr-x 2 0 0 4096 Nov 21 12:01 Desktop/
whereas a user will see
Quote:
bash-4.3$ ls -n
drwxr-xr-x 2 1000 100 4096 Dec 15 17:37 Desktop
Admin, incidentally, is windows speak. There is no admin on ;inux. root has unlimited power, so use it wisely.
 
Old 12-28-2015, 08:36 AM   #3
nitsss
LQ Newbie
 
Registered: Dec 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Unhappy Admin is not allowed to run sudo on localhost. This incident will be reported.

actually Admin is an user which is created during OS installation.

[Admin@localhost ~]$ ls -n
total 52
drwxr-xr-x. 2 500 500 4096 Dec 28 13:01 Desktop
drwxr-xr-x. 2 500 500 4096 Nov 24 15:25 Documents
drwxr-xr-x. 2 500 500 4096 Dec 22 16:25 Downloads
-rw-r--r-- 1 0 0 29 Dec 5 15:23 hello
drwxr-xr-x. 2 500 500 4096 Nov 19 12:08 Music
----r-x--- 1 500 500 54 Nov 27 11:27 names.acl
drwxr-xr-x 2 0 0 4096 Nov 30 12:06 nitsss
drwxr-xr-x. 2 500 500 4096 Nov 19 12:08 Pictures
drwxr-xr-x. 2 500 500 4096 Nov 19 12:08 Public
drwxr-xr-x. 2 500 500 4096 Nov 19 12:08 Templates
drwxrwxr-x 2 500 500 4096 Nov 26 11:02 test123
---x--x--x 1 500 500 102 Nov 30 16:38 test.sh
drwxr-xr-x. 2 500 500 4096 Nov 19 12:08 Videos
 
Old 12-28-2015, 09:01 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,518

Rep: Reputation: 3134Reputation: 3134Reputation: 3134Reputation: 3134Reputation: 3134Reputation: 3134Reputation: 3134Reputation: 3134Reputation: 3134Reputation: 3134Reputation: 3134
Welcome to LinuxQuestions

What distribution/version are you running?

Most distributions not Ubuntu based do not enable sudo by default. As an example to enable sudo on debian:
https://wiki.debian.org/sudo
 
Old 12-28-2015, 09:11 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by nitsss View Post
actually Admin is an user which is created during OS installation.
Is the OS installed?
Are you trying to modify sudoers in a Live* Environment?
Sounds like it.

Did you logout and back in after adding yourself to the visudo file?
 
Old 12-28-2015, 10:05 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,591

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Quote:
Originally Posted by nitsss View Post
Admin is not allowed to run sudo on localhost. This incident will be reported.


nitsss

Oh Boy are you in big trouble now ... I hope your mom don't find out too...

ensure you're in the group of sudo, or add yourself to a wheel group that is sometimes in sudo, create a group called wheel, or sudo then add yourself to that group ensure it is in the sudoers file,
you can also have it so that you do not have to use a password if you did not know that, just type sudo <command> press enter

Code:
## Uncomment to allow members of group wheel to execute any command
# wheel ALL=(ALL) ALL

## Same thing without a password
#(percent mark)wheel ALL=(ALL) NOPASSWD: ALL
or this will get a user w/ no password needed
Code:
user-name ALL=(ALL) NOPASSWD: ALL
if you want password needed then
Code:
user-name ALL=(ALL) ALL
if you put your user name into a group that is in sudoers then just add yourself to that group instead
and make sure sudo is installed

Last edited by BW-userx; 12-28-2015 at 10:17 AM.
 
Old 12-28-2015, 01:31 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137
You need to tell us what OS you're running, why you think sudo should work in the first place, and what your sudoers file looks like.
 
Old 12-29-2015, 01:01 AM   #8
nitsss
LQ Newbie
 
Registered: Dec 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Admin is not allowed to run sudo on localhost. This incident will be reported.

i m using CentOs 6.
After adding the Admin user in visudo file, when i m running sudo command below is the result.

[Admin@localhost ~]$ sudo apt-get update
[sudo] password for Admin:
sudo: apt-get: command not found
 
Old 12-29-2015, 01:10 AM   #9
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,342
Blog Entries: 11

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
That is most likely because centos does not use apt as its package manager.

I think Debian distros use apt, RedHat distros use yum or rpm.
 
Old 12-29-2015, 01:10 AM   #10
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian
Posts: 1,054

Rep: Reputation: 281Reputation: 281Reputation: 281
CentOS does not use apt as the package manager. Apt is a Debian package, including Debian-based distros.
 
Old 12-29-2015, 02:31 AM   #11
nitsss
LQ Newbie
 
Registered: Dec 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
After adding the Admin user in visudo file, when i m running sudo command below is the result.

thnxs to all,

After adding the user in sudoers file, i used yum cmnd & is sorted by using yum instead of apt.

thnxs again..
 
Old 12-29-2015, 08:25 AM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Glad to be of help.
 
Old 12-29-2015, 09:54 AM   #13
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137
Quote:
Originally Posted by nitsss View Post
i m using CentOs 6.
After adding the Admin user in visudo file, when i m running sudo command below is the result.

[Admin@localhost ~]$ sudo apt-get update
[sudo] password for Admin:
sudo: apt-get: command not found
...

PLEASE tell me you're not trying to implement the abomination that is Ubuntu's root policy on CentOS!

Leave that crap where it belongs, [in the trash] on Ubuntu, don't let it infect the rest of the Linux world. Sudo is a very powerful tool for allowing a SPECIFIC user to run a SPECIFIC task without having to get out the root password. It was never designed to give a user complete administrative privileges using their normal user password. There already IS a user who can do that, it's called root.

This sudo abuse championed by Ubuntu does not make things better or safer, it compromises security in order to make Linux more Windows-like, so it's not as "scary" for new users. Do yourself a favor and learn how to PROPERLY administer a Linux system, don't try to turn CentOS into another Ubuntu.

Last edited by suicidaleggroll; 12-29-2015 at 09:56 AM.
 
Old 12-29-2015, 09:56 AM   #14
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,591

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Quote:
Originally Posted by suicidaleggroll View Post
...

PLEASE tell me you're not trying to implement the abomination that is Ubuntu's root policy on CentOS!

Leave that crap where it belongs, [in the trash] on Ubuntu, don't let it infect the rest of the Linux world. Sudo is a very powerful tool for allowing a SPECIFIC user to run a SPECIFIC task without having to get out the root password. It was never designed to give a user complete administrative privileges using their normal user password. There already IS a user who can do that, it's called root.

This sudo abuse triggered by Ubuntu does not make things better or safer, it compromises security in order to make Linux more Windows-like, so it's not as "scary" for new users. Do yourself a favor and learn how to PROPERLY administer a Linux system, don't try to turn CentOS into another Ubuntu.
Yeah what he said!

go ROOT !!!
 
Old 12-29-2015, 10:52 PM   #15
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,700

Rep: Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494
Definitely post #13 ++

Ubuntu has a lot to answer for ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Phpmyadmin only allowed from localhost - do I still need ssl? Linuxstudent Linux - Security 2 10-23-2011 09:34 AM
"this incident will be reported" newbiesforever General 14 08-11-2011 05:24 PM
This incident will be reported sulekha Ubuntu 4 11-15-2008 07:31 AM
Can a sudo user be allowed use relative path yksudha Linux - Security 1 06-11-2008 02:02 AM
I can't run any thing with admin previlages, except in the terminal using sudo. fayezderya Linux - Software 2 03-24-2008 08:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:49 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration