Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
pi@raspberrypi:~ $ sudo cat /etc/sudoers
#
# 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
pi ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
%pi ALL=(ALL:ALL) NOPASSWD: ALL
#pi ALL=(ALL) NOPASSWD: ALL
# See sudoers(5) for more information on "#include" directives:
The sudo configuration file controls sudo, not general permissions. Your configuration file allows the pi user to use sudo to run any file, not to run any file in general.
ssh pi@172.16.0.88 sudo ip a add 192.168.1.10/24 dev eth0
assuming that 24 is the correct prefix size.
hi berndbausch,
I have been using Fedora for a long time, in which this error is not seen. Many of my automation scripts are written without sudo. To make my scripts compatible for both Fedora and pi, I need this configuration. Please help in getting some work around.
I have been using Fedora for a long time, in which this error is not seen. Many of my automation scripts are written without sudo. To make my scripts compatible for both Fedora and pi, I need this configuration. Please help in getting some work around.
The error occurs because an unprivileged user can't set IP addresses.
If your Fedora system allows a non-root user to set an ip address, the user might have received the privilege to manage networking via the CAP_NET_ADMIN capability.
Or the ipconfig command has the setuid flag. Which would be a horrible security breach.
Other than that, I don't know how this is possible for a non-root user.
Last edited by berndbausch; 03-09-2020 at 04:15 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.