LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Closed Thread
  Search this Thread
Old 02-07-2017, 10:15 PM   #16
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,384
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164

Remember, the creepy sudo fetish is a *buntu thing. Non-*buntu distros expect you to use su.

If you want to use sudo on Debian, you will need to edit the sudoers file accordingly.
 
Old 02-07-2017, 10:34 PM   #17
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Thanks, I did not know that.
 
Old 02-08-2017, 07:34 AM   #18
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 Fixit7 View Post
Still getting
well what does your sudoer file look like? especially that line that has the word sudo within it.

Code:
cat /etc/sudoers
(copy paste into post)
Code:
cat /etc/groups | grep sudo
copy paste into post
that one might be
Code:
cat /etc/group | grep sudo
I keep forgetting if it needs the 's' or not
Code:
groups
copy paste into post

Last edited by BW-userx; 02-08-2017 at 07:39 AM.
 
Old 02-08-2017, 07:55 AM   #19
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Here you go.

Quote:
andy@new-host:/$ su cat /etc/sudoers
No passwd entry for user 'cat'

andy@new-host:/$ cat /etc/groups | grep sudo
cat: /etc/groups: No such file or directory

andy@new-host:/$ cat /etc/group | grep sudo
sudo:x:27:

andy@new-host:/$ groups
andy cdrom floppy audio dip video plugdev netdev lpadmin scanner
 
Old 02-08-2017, 08:05 AM   #20
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 Fixit7 View Post
Here you go.
Ok
Fixit7
Senior Member
Contributing Member

first of all your syntax is wrong that is why it is not working - google syntax

where is the order to your madness? (that is just a phrase)
Code:
andy@new-host:/$ su cat /etc/sudoers
No passwd entry for user 'cat'
su first then password then command

Quote:
andy@new-host:/$ cat /etc/group | grep sudo
sudo:x:27:

andy@new-host:/$ groups
andy cdrom floppy audio dip video plugdev netdev lpadmin scanner
you're not attached to sudo group yet, what happened?
if you where attached to sudo group it'd look like this
Code:
sudo:x:27:andy

andy cdrom floppy audio dip video plugdev netdev lpadmin scanner sudo
the word sudo would be in that line somewhere, I just put it at the end.

command prompts indicating what level of user is issuing command.
$ - reg user
# - root user

remember the steps
  1. $su
  2. $password
  3. #usermod -aG sudo andy
Log out log in to let it take effect.

hopefully within your sudoers file you have the sudo uncommitted so that anyone attached to the sudo group will get root priv.

Last edited by BW-userx; 02-08-2017 at 08:12 AM.
 
1 members found this post helpful.
Old 02-08-2017, 08:18 AM   #21
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Keep in mind that I first used ubuntu which does use sudo <command>.

Quote:
where is your order to your madness? (that is just a phrase)
Try to chill. I am only human. :-)

Quote:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

andy ALL=(ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
root@new-host:/home/andy#
root@new-host:/home/andy# cat /etc/groups | grep sudo
cat: /etc/groups: No such file or directory

Last edited by Fixit7; 02-08-2017 at 08:19 AM.
 
Old 02-08-2017, 08:22 AM   #22
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 Fixit7 View Post
Keep in mind that I first used ubuntu which does use sudo <command>.



Try to chill. I am only human. :-)



root@new-host:/home/andy# cat /etc/groups | grep sudo
cat: /etc/groups: No such file or directory
Let that do the work. That is what it is there for.
Quote:
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
did you change that sudo line?
Code:
%sudo ALL=(ALL:ALL) ALL
should be??
%sudo ALL=(ALL) ALL
BUT if you insist to have it that other way then
Code:
andy ALL=(ALL) NOPASSWD:ALL
give that a try.

Last edited by BW-userx; 02-08-2017 at 08:36 AM.
 
Old 02-08-2017, 08:33 AM   #23
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
I use wheel group

Code:
(userx@slacko⚡️~)>>$ grep wheel /etc/group
wheel:x:10:root,userx
Code:
(userx@slacko⚡️~)>>$ groups
userx lp wheel floppy audio video cdrom plugdev power netdev scanner
Notice no need for a password.
Code:
(userx@slacko⚡️~)>>$ sudo cat /etc/sudoers
## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##

##
## Runas alias specification
##

##
## User privilege specification
##
root ALL=(ALL) ALL

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

## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL


## Uncomment to allow members of group sudo to execute any command
# %sudo	ALL=(ALL) ALL

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw  # Ask for the password of the target user
# ALL ALL=(ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'

## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d
you can do the same with sudo
Code:
## Same thing without a password
%sudo ALL=(ALL) NOPASSWD: ALL

Last edited by BW-userx; 02-08-2017 at 08:41 AM.
 
Old 02-08-2017, 08:44 AM   #24
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
slow down and give this a read

sudo-and-sudoers-configuration

https://serversforhackers.com/video/...-configuration
 
Old 02-08-2017, 09:13 AM   #25
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Quote:
Originally Posted by BW-userx View Post
Let that do the work. That is what it is there for.


did you change that sudo line?
Code:
%sudo ALL=(ALL:ALL) ALL
should be??
%sudo ALL=(ALL) ALL
BUT if you insist to have it that other way then
Code:
andy ALL=(ALL) NOPASSWD:ALL
give that a try.
I did so.

How do I know if it works ?
 
Old 02-08-2017, 09:22 AM   #26
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
since it is the sudoers file (I hope you edited it with visudo), you can try now sudo.
sudo apt-get update
was your original question, it should work if you properly set that.
 
Old 02-08-2017, 09:31 AM   #27
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
to change the visudo to use nano instead

Code:
sudo export VISUAL=nano
sudo export EDITOR=nano
then type
Code:
visudo
you should be in nano and no longer vi to edit your sudoers file. It worked in Slackware.

But me I just do this
Code:
sudo nano /etc/sudoers
hehe

Last edited by BW-userx; 02-08-2017 at 09:33 AM.
 
Old 02-08-2017, 11:21 AM   #28
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Quote:
Originally Posted by pan64 View Post
since it is the sudoers file (I hope you edited it with visudo), you can try now sudo.
sudo apt-get update
was your original question, it should work if you properly set that.
Yes, I used visudo.

It works now.

Thanks a lot.
 
Old 02-08-2017, 11:22 AM   #29
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Quote:
Originally Posted by BW-userx View Post
to change the visudo to use nano instead

Code:
sudo export VISUAL=nano
sudo export EDITOR=nano
then type
Code:
visudo
you should be in nano and no longer vi to edit your sudoers file. It worked in Slackware.

But me I just do this
Code:
sudo nano /etc/sudoers
hehe
Is there an advantage to using nano ?
 
Old 02-08-2017, 11:24 AM   #30
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 Fixit7 View Post
Is there an advantage to using nano ?
user preference is all. VI and its commands I do not like, that was written way back before they even had a mouse so they had to come up with inventive ways to do everything with a keyboard. I do not like what they came up with.
 
  


Closed Thread



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] User not in sudoers: How to add user? Permtion Denied for sudoers file esgol Linux - Newbie 3 07-13-2012 07:44 AM
Sudoers file gone? L-p-BTM Linux - Newbie 6 02-02-2012 11:58 AM
Fedora /etc/sudoers file and sudoers.d directory davejjj Linux - Newbie 2 10-21-2011 06:19 PM
not in the sudoers file? underworld288 Slackware 3 06-18-2007 12:48 AM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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