Questions tagged [sudo]
The sudo command is a program for some Unix and Unix-Like operating systems, that allows a user to execute programs with the security privileges of another user. Typically those of a superuser or the root user.
1,141
questions
0
votes
0
answers
16
views
Why would sudo complain about DNS name resolution? [duplicate]
I'm running on Ubuntu 22 Linux. When I try to manually fix my /etc/resolv.conf file using
sudo vi /etc/resolv.conf
# or
sudo cp $HOME/tmp/working-resolv.conf /etc/resolv.conf
The command appears to ...
1
vote
1
answer
17k
views
SUDO - Error with sudoers_audit plugin
I have one problem with sudo. When I run sudo in regular account I get:
sudo: PERM_ROOT: setresuid(0, -1, -1): Permission denied
sudo: error initializing audit plugin sudoers_audit
But I commented ...
1
vote
2
answers
19k
views
sudo: PAM account management error: Permission denied
I'm trying connect a Linux machine to AD and I made some changes in some files below:
/etc/krb5.conf
/etc/pam.d/system-auth
/etc/samba/smb.conf
After these changes I connected the server to AD with ...
8
votes
6
answers
6k
views
Allowing automatic command execution as root on Linux using SSH
What is a good setup that allows automatic execution of a command or a script on a remote server with root privileges using SSH?
I'm aware (only vaguely for some the options) of the following options:
...
0
votes
0
answers
7
views
sudo visudo in a Dockerfile with CentOS base image
I am creating a Dockerfile using the centos:7 base image. I need to edit the file at etc/sudoers and append NOPASSWD privileges to it for a new user and some groups.
I have looked up in forums that ...
0
votes
1
answer
12k
views
error: XDG_RUNTIME_DIR not set in the environment. Gtk-WARNING **: cannot open display:
I used to open text files with sublime, and for Read-only files, I used to do :
sudo sublime. But now just suddenly the sudo sublime command gives the following error :
(sublime:3931): Gtk-WARNING **:...
4
votes
2
answers
48k
views
sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?
I've been using cronopete and timeshift to do my backups on Pop!_OS. cronopete for just /home and timeshift for the entire system.
I put in a new m.2 NVMe drive hoping I could just restore the ...
3
votes
2
answers
4k
views
Require bash script to be run with sudo (not as root user)?
I want to require a bash script to be run as the current user with sudo, but prevent it from being run if it was executed as the root user directly. This is because I'm doing some setup actions for ...
-1
votes
0
answers
39
views
I need to enable Linux on crosh but I cannot enable it
I want Linux on my Lenovo IdeaPad Flex 5 13ITL6 Chromebook and I tried in settings but it said I cannot so I tried crosh (Ctrl+Alt+T) and I tried:
sudo cros config enable linux
Because I locked it up ...
0
votes
0
answers
21
views
Validating Changes to pam.d (like visudo)
I'm working on an Ansible task for setting fingerprint sudo usage in MacOS. This is done through a custom rule in /etc/pam.d/sudo_local.
Is there a method to pre-validate edits to PAM for safer ...
-1
votes
1
answer
54
views
passthru background process sudo multiple commands
Have problem running the command in background. Below is configuration of code.
1] Using php passthru running a command as a different user than current
2] The command has multiple commands to run ...
0
votes
1
answer
166
views
macos terminal with sudo cannot find hidden file
Im executing the command in mac terminal
sudo /Users/username/someFolder/programForMacOs
programForMacOs runs and looks for a file in the same directory its running from (/Users/username/someFolder/) ...
1
vote
1
answer
41
views
Runing a command as user is not the same as logging as the user and running the command
I am trying to get a way to execute a script from a root session, but I am having some trouble with it. I'll lay out the issue:
I have a script that performs some tasks as the regular user 'kolterdyx',...
0
votes
0
answers
90
views
start non-root user systemd and systemd services via sudo without enable-linger
I'm like to be able to start a systemd session (e.g. systemd --user) for a given non-root user, and subsequently start a service (e.g. systemctl --user start SERVICE.service), all via a sudo -iu USER ...
1
vote
1
answer
5k
views
sudo: no valid sudoers sources found, quitting
On Amazon Workspaces I ran sudo chmod -R 777 /etc in order to create a file to install Docker but now after every command with sudo I run into this error
sudo: /etc/sudo.conf is world writable
sudo: /...
0
votes
2
answers
4k
views
Can't run the ls command on the root directory without using sudo
CentOS 7.6.180
GNOME-CLASSIC 3.28.2
I've always been able to run ls on the / directory in the system above.
Now it just hangs when I run ls. Same if I try to see the / dir with software other than ...
0
votes
4
answers
9k
views
sudo command is not working on Ubuntu 16.4
I have a linux Ubuntu laptop (16.4) that was not supporting any command starting from sudo and I have googled but not getting any solution because we don't know root user and password, so I am totally ...
89
votes
5
answers
177k
views
Why does the system have /etc/sudoers.d? How should I edit it?
Last time, I asked about the risk of these (in /etc/sudoers):
user_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf
%group_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf
While I was ...
0
votes
0
answers
20
views
Mac's sudo not sanitize PATH from user's setting?
Mac's sudo behaviour is unlike everywhere else, of which just like observed in Passing PATH through sudo, sudo would flush PATH every time.
However, I found in Mac, my PATH setting is carried into ...
0
votes
0
answers
40
views
Zipping a folder and sub-directories not working without sudo?
I wrote a python script using Amazon's AWS Boto3 SDK to download files from an S3 bucket and puts them in a folder (in a directory within my home dir). For reference, the function I used was the s3 ...
0
votes
0
answers
113
views
Running App as root using Apple Script?
I am trying to use an Apple Script to run an application as root without asking for password all the time. I used this Apple Script code:
do shell script "/Applications/MyApp.app" user name &...
-2
votes
3
answers
109
views
Is using SUDO in the terminal of the Mac safe?
I've recently begun programming in Java using VS Code. Recently, I purchased a used 2019 MacBook Touch Bar, and I'm still getting used to using the terminal to troubleshoot issues.
Regrettably, I used ...
1
vote
2
answers
7k
views
Stuck on immersivelabs sudo
I have a lab to complete that requires the following:
Become the ‘pseudo’ user, using the previously discovered password. What is the token contained in the file /root/token.txt?
I have completed ...
2
votes
1
answer
479
views
How to start WireGuard client without sudo privileges?
I am desperately trying to set up a "sudoless" way to start a WireGuard tunnel. The user has no elevated rights on Debian 12 Bookworm.
The user needs a simple way to get access to a terminal ...
0
votes
3
answers
416
views
How to allow apps to open and perform actions as sudo?
I am running Debian 12 with KDE Plasma desktop 5.27 and my problem is that every time I open an app it won't allow me to do things as sudo or permissions are not set correctly.
For example, when I ...
0
votes
0
answers
62
views
Why 892 bytes altered not 446 bytes? 446x2=892 bytes [duplicate]
Experiments were done, before re-purposing a disk:
re-purposing = delete all data
re-purposing = delete all partitions
re-purposing = fill disk with all zeros
re-purposing = confirm all zeros, confirm ...
23
votes
1
answer
4k
views
one sudo for multiple terminals
Sudo root permissions are given for specific time, but only for one terminal. If I want to use sudo in another terminal in that time period, I have to type password again. How to force sudo to works ...
0
votes
2
answers
2k
views
How to properly fix [sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set]
I've run this:
sudo chmod -R 755 /usr/bin/
and after that got this every time when I use sudo:
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
I use Fedora 37. Does anybody ...
1
vote
1
answer
5k
views
I am getting "ln: /usr/local/bin/<Cask>: Permission denied" when trying to install some casks
I have installed Homebrew and Cask to my machine, and it has worked for some things. But I sometimes get an error saying
==> ln: /usr/local/bin/<Cask name>: Permission denied
Error: Command ...
0
votes
2
answers
4k
views
How to undo a mistake in sudoers file?
I accidentally command the root admin and sudo in sudo visduo file.
Now with current user it is not rolling it back because I can't access it any more.
File does not get opened with command sudo ...
4
votes
2
answers
2k
views
Can I have sudoedit check `$EDITOR` like visudo does?
As far as I know, the major difference is that visudo has a simple parser for seeing if /etc/sudoers (and other sudoers files) is goodly; however, I also noticed that, when I set EDITOR=emacs, ...
0
votes
2
answers
97
views
Why does sudoers.d ignore filenames with dots in them?
by default sudo parse config files in /etc/sudoers.d/* whose filename does not contain . and ~ , meaning user.conf is ignored and user_conf is parsed.
Why does /etc/sudoers.d ignore files with dots in ...
0
votes
0
answers
209
views
Google authenticator MFA codes aren't working in Linux
I want to enable MFA to use sudo commands on my laptop running Debian. I followed steps to enable this, and had the verification codes working for the desktop log in. But in terminal it keeps saying &...
35
votes
6
answers
51k
views
sudo apt-get update couldn't create temporary file
Tried to do sudo apt-get update, get this response every time I run it:
Get:1 http://repo.radeon.com/rocm/apt/debian xenial InRelease [1814 B]
Get:2 http://security.ubuntu.com/ubuntu bionic-security ...
1
vote
1
answer
4k
views
Could not install packages due to an EnvironmentError: [Errno 1] Operation not permitted in the virtual envinronment
I tried to make a python virtualenvironment using virtualenv in
I type virtuelenv env --python=python3
I get an error
PermissionError: [Errno 1] Operation not permitted: '/mnt/d/venv/bin/python3'
...
19
votes
2
answers
68k
views
How can I make my own account a sudoers on VirtualBox?
I have Windows 10 installed on my computer. I installed Oracle VirtualBox and created a machine with Ubuntu 20.04. I need administrative privileges on this machine but, for some reason, I cannot have ...
0
votes
2
answers
127
views
rsync to server and set ownership and permissions, use sudo
I have a server with a website, /var/www/html/website.
I use rsync to transfer updated files over:
rsync -avzu --no-perms --no-owner --no-group --chown=user:www-data --progress /mnt/c/xampp7/htdocs/...
9
votes
1
answer
2k
views
sudo password not working over ssh
I have a user on my local (virtual) machine with sudo privileges and when I login with this user I can run SUDO commands such as:
$ sudo ls
[sudo] password for <user>: ***PASSWORD ENTERTED***
&...
0
votes
0
answers
54
views
Can I give a directory back to superuser?
I'm on macOS Sonoma. I was installing some Python and C packages in Homebrew, and it asked me to run:
sudo chown -R username /usr/local/opt
And:
chmod u+w /usr/local/opt
Now that I've installed the ...
1
vote
0
answers
135
views
Why is sudo taking a long time to execute
When running commands with sudo it always takes about 4 or 5 seconds for the command to run even something as simple as echo test.
I am running rhel 9.
After looking at some other question I ran sudo ...
0
votes
2
answers
6k
views
How do I fix "Sudo commands will not succeed by default" on chromeOS Crosh Shell
I have been trying to install SeaBios for Ubuntu, and all of them say I need to use
Crosh Shell, every time I try to use it though it says "Sudo commands won't succeed by default" how can I ...
7
votes
5
answers
8k
views
Changed sudoers file and can't open it anymore; can't open any file using root
I changed settings in sudoers file using
sudo visudo
and messed it up. Now when I try to do it again or open any file using sudo, I can't open it anymore and I get this error message:
>>> ...
0
votes
1
answer
557
views
Getting error while downloading Java
I am trying to install Java in my AWS EC2 instance by using this below command:
sudo yum install java-1.8.0-openjdk-devel
But I'm facing the below error:
No match for argument: java-1.8.0-openjdk....
1
vote
2
answers
270
views
How to switch user to subuid running LXC container?
I'd like to either use su or sudo -u to switch users to the subuid created by LXC to run a container as unprivileged.
Note:
There is no username assigned to the UIDs in which containers are run.
Due ...
1
vote
1
answer
3k
views
How to run python script on startup with sudo permission on Mac OS
I have created a script with python that basically ping all servers found in my lists. I need this script to be run on startup with sudo permission.
So the question is, How do you run the script on ...
0
votes
1
answer
218
views
sudo passwd for bash terminal
I am total newbie so excuse the lack of knowledge, but I recently created an Microsoft Azure account so it comes equipped with a bash terminal. I wanted to make sure it is up-to-date so I tried ...
0
votes
0
answers
137
views
Shell script run by launchd in MacOS can't create at job
I'm using the privileges.app to grant users temp admin privileges.
Because I need to have password auth and justification enabled via config, I can't use the build-in feature to limit the duration of ...
0
votes
0
answers
52
views
Very weird linuxbrew installation issue
I am installing linuxbrew in a linux machine. I typed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
in the console. However it says
==> /...
5
votes
2
answers
3k
views
How can I view systemd timers for all users?
I have some users running in linger mode on Ubuntu and Arch Linux systemd systems. Meaning, users' timers can be running even if they are not logged into the system. As a root user, how can I see all ...
0
votes
0
answers
61
views
How did this usage of chmod break sudo access?
In many other topics, I have seen people breaking their sudo access with commands such as
sudo chmod -R 777 /
and variants. Thinking I was doing it right, I have executed the following commands on a ...