LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 06: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, 07:22 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,289

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
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, 07: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, 08:01 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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, 08:11 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
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, 09:05 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
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 09:17 AM.
 
Old 12-28-2015, 12:31 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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, 12: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, 12:10 AM   #9
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
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, 12:10 AM   #10
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
CentOS does not use apt as the package manager. Apt is a Debian package, including Debian-based distros.
 
Old 12-29-2015, 01: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, 07:25 AM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

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

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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 08:56 AM.
 
Old 12-29-2015, 08:56 AM   #14
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
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, 09:52 PM   #15
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

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

Ubuntu has a lot to answer for ...
 
  


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 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 08:34 AM
"this incident will be reported" newbiesforever General 14 08-11-2011 04:24 PM
This incident will be reported sulekha Ubuntu 4 11-15-2008 06:31 AM
Can a sudo user be allowed use relative path yksudha Linux - Security 1 06-11-2008 01:02 AM
I can't run any thing with admin previlages, except in the terminal using sudo. fayezderya Linux - Software 2 03-24-2008 07:46 AM

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

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