1

I have edited my permissions file and setup 2 user accounts -premlaks and stack with sudo access.

After setting up this, I login to stack user and try to change permissions for few files but still its not working..I have to append sudo to any command..

I thought I can execute any command once I give sudo access.

# 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        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
premlaks        ALL=(ALL:ALL) ALL
stack   ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

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

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

#includedir /etc/sudoers.d
1
  • 2
    "I have to append sudo to any command" - yes, that's how sudo works: adding you users to the sudoers file does not remove that requirement Aug 17, 2015 at 2:12

1 Answer 1

1

You have to add that user to sudo group with usermod command.

For instance, for me this would be like so

usermod --groups serg,sudo  serg

More info in the man usermod, eg

-G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
    A list of supplementary groups which the user is also a member of.
    Each group is separated from the next by a comma, with no intervening
    whitespace. The groups are subject to the same restrictions as the
    group given with the -g option.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .