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,142
questions
0
votes
1
answer
277
views
remote execution of command failing due to sudo issue
i am running a command from my server which would remotely ssh to by client machine as root and sudo as olcne user and run few commands for validation. I have added the olcne user in sudoer list. i ...
3
votes
1
answer
1k
views
Set individual password timeout on sudo command
I have a long running script which runs as normal user then then has sudo make install towards the end which (if I don't notice it finishes within 5 minutes) times out and fails.
In man sudoers it ...
0
votes
0
answers
435
views
user with restricted bash: sudo su works but su doesn't
I'm creating an user with restricted bash. I've blocked all commands except few commands as per a requirement.
Now if I want to change to root using su - root, even with correct password, it says ...
2
votes
2
answers
3k
views
linux sudoers not work on command `su`
I want to disable command sudo and su for user in group staff.
So I put this in /etc/sudoers:
%staff ALL=ALL, !/usr/bin/sudo,!/usr/bin/su
But I found, only sudo work, su still work for user in ...
1
vote
1
answer
2k
views
Why apt needs sudo for almost every package install/update but Homebrew doesn't?
Why Homebrew doesn't even allow installing packages using sudo brew install foo, but almost every single apt package or tutorial tells to install with sudo apt-get install bar?
What's so drastically ...
0
votes
1
answer
1k
views
What is the difference between a "sudo reboot" command and a "ipmitool power reset" command?
From what I can find online sudo reboot and ipmitool power reset are warm reboot commands
Are there actually any differences between these two or are they just the same thing with a different method ...
0
votes
1
answer
1k
views
Running sudo python and python as SU use two different versions [duplicate]
I understand sudo doesn't run a command as the current user, but I don't understand why the two following commands produce differing outputs:
Case 1:
user@.../folder$ sudo python
Python 2.7.17 (...
0
votes
2
answers
780
views
Get the default user name from a script run with sudo
I need to get this user name for my scripts that need to execute some commands without sudo with sudo -u username foo. But I need this username from the scripts executed with sudo.
How can I achieve ...
0
votes
1
answer
3k
views
Delete (remove) Clover created EFI folder in macOS Catalina
I have a couple of folders that were created by Clover when I accidentally selected my OS hard drive instead of the EFI partition when installing an update. Now the root of my main hard drive has EFI ...
0
votes
1
answer
915
views
How do I release a blocked sudo user
I use a centos instance for a production system. I do not know how But the root password was enabled or centos user was removed from sudoers. Before I was able to run sudo commands or even run sudo su ...
2
votes
1
answer
2k
views
sudo -l and sudo -ll output
sudo -l gives me output:
User test may run the following commands on server:
(root) NOPASSWD: /usr/bin/vim /usr/bin/motd
sudo -ll gives me output:
Sudoers entry:
RunAsUsers: root
Options: !...
0
votes
1
answer
809
views
How to set the default user for authenticating a pamac command on Manjaro Linux
I recently added another user to my Linux installation, which I myself also use.
When I try to execute the pamac command, It has always asked for authentication with this header:
==== AUTHENTICATING ...
0
votes
1
answer
2k
views
sudo apt-get update && upgrade runs on root, but not with sudo as normal user
Not much else detail to add. Latest release of Parrot OS, I'm curious why I could only get my update && upgrade to run as the root user, when AFAIK using sudo as my normal privilege user ...
2
votes
4
answers
3k
views
How to run GUI applications as another user on Linux, without SSH and kde/gksudo?
Now that kdesudo and gksudo are disappearing from distributions, what is a reasonable way to run a GUI application as a different user?
My use case is that I do not want the application to be able to ...
0
votes
1
answer
3k
views
Solved - sudo into user instead of root with rundeck
i'm configuring a server for some bioinfo analysis on Centos7 and i installed rundeck.
Rundeck seems to launch scripts as its own account name and i decided to use the sudo bypass to make it access my ...
3
votes
1
answer
8k
views
Amazon Linux 2 su command not found
even though I am already working with Linux for years somehow I can't figure out the following issue.
I am using the following docker image:
amazoncorretto:11.0.6
When going into that image
docker ...
0
votes
2
answers
1k
views
Parse error in sudoers after giving sudo access without password
I am making a desktop application for Linux that interacts with some Ubuntu system files. As such, during the end-user's installation of my software, I need to generate a file in /etc/sudoers.d/ ...
-2
votes
2
answers
7k
views
how to run sudo command in kali 2020.1
I know that kali linux 2020.1 does not support root user.
but I have following case
when I installed it on my pc (i368) it has black screen login, I tried starting lightdm service but failed. now I ...
0
votes
1
answer
1k
views
passwordless pkexec to unprivileged user
For several reasons I want to run my browser as a different system user on my fedora box.
For now I created a separate system user named sandbox and created a custom ~/.local/share/applications/...
1
vote
1
answer
880
views
So i modified my sudoer file and now sudo hangs and I can't change it back
I was having fun messing around in terminal when suddenly, I messed up my sudoers file in /etc/. Now the sudo command hangs and I am not able to change it back. I would rather not reset my computer ...
1
vote
2
answers
3k
views
sudo doesn't have access to globally installed software
tl;dr I am trying to run a command with sudo, but it only works without using sudo. Read below for more details.
Hoping a linux expert might be able to spot the problem here. I installed ef core, per ...
1
vote
0
answers
28
views
sudo asks password although there is nopasswd parameter [duplicate]
I edited the sudoers file like below:
myuser ALL=(ALL) NOPASSWD: ALL
newuser ALL=(ALL) NOPASSWD: ALL
There is no another line that contains "myuser" in sudoers file. But ...
1
vote
1
answer
1k
views
supply password for sudo and openconnect in one alias command
I want to make an alias for openconnect, the alias is
echo "password" | sudo openconnect server --user=username --passwd-on-stdin --no-cert-check
Everything works fine but my problem is that each ...
1
vote
2
answers
20k
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 ...
0
votes
2
answers
10k
views
Users are able to become root using "sudo sudo su -"
I have given below permissions in sudoers file.
Cmnd_Alias SUROOT=/bin/su "",\
/bin/su -,\
/bin/su - root,\
/bin/su root,\
...
0
votes
2
answers
6k
views
Cannot install libhdf5-dev (or any hdf5 dependency) on Ubuntu 18.04 LTS (arm64 -aarch64)
I am trying to install hdf5 on Ubuntu 18.04 on Nvidia's Jetson Nano device (arm64 structure). Have attempted to do the basic recommended installation: 'sudo apt-get install libhdf5-serial-dev
I have ...
0
votes
1
answer
1k
views
How can I change user and keep my .profile
I often have to work as root (using sudo), but I want to keep my settings from my login profile - I have had this working in the past, but I don't quite remember how I made it work. This is what I've ...
0
votes
1
answer
685
views
Make it so only I can access fstab despite other users having sudo
I have a server that multiple users access. On that server a CIFS drive is mounted through fstab.
Mounting the CIFS drive requires sending the password in plaintext. This is not something I can ...
0
votes
1
answer
336
views
Difference between deleting folders using sudo or as root
Today I noticed an interesting difference between executing an command using sudo or as root.
Using sudo rm -rf /opt/nextcloud/* will not delete folders
vagrant@collab:~$ sudo rm -rf /opt/nextcloud/...
2
votes
1
answer
3k
views
Become root on ssh client
I'm trying install an agent named cloudamize with a bash script to our linux machines. There is two commands for this process:
export CLOUDAMIZE_CUSTOMER_KEY=<my_customer_key>
bash < <(...
0
votes
2
answers
1k
views
not in the sudoers file
I added a user to the sudoers file using ['sudo gpasswd -a orca wheel']. This command was successful as per ""Adding user orca to group wheel"" but the user can not execute root commands still. I ...
0
votes
1
answer
1k
views
Sudo not working on CentOS 7
so my school had me try to disable root login by editing /etc/passwd file, root:x:0:0:root:/root:/sbin/nologin
the plan is to have me use sudo commands to then revert this change. but since doing ...
0
votes
1
answer
605
views
a change with visudo doesn't work
I issue visudo command, add this rule to the very end of the file, save the file and quit.
newuser ALL=/usr/sbin/useradd
However newuser is still able to run such commands as
sudo touch file1
...
36
votes
6
answers
52k
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
7k
views
Changed root / file ownership, any way back?
I have made a typo and ran
chown -R username /* instead of ./* as a root, and messed up everything.
Now, can't login as a root and change the ownerships back. Any way to repair without having to ...
5
votes
2
answers
29k
views
Can someone explain what is `<user> ALL=(ALL) NOPASSWD:ALL` does in sudoers file?
I know that that line above allows <user> to run sudo command without having to type in the password. But what does the syntax actually mean? If you can link to an article then that would be ...
0
votes
2
answers
3k
views
Run interactive shell within nested ssh connection in script
Suppose I want to connect to machine B via machine A. As I learned, there are multiple ways to achieve this, for example
ssh -T -J user@machineA user@machineB << END_OF_SSH_CONNECTION
# Some ...
9
votes
3
answers
15k
views
Run "cd" command as superuser in Linux
Is there a way to run the cd command with superuser privileges to gain access to directories that are owned by root? When I run sudo cd <path>, I get sudo: cd: command not found.
0
votes
3
answers
478
views
How to prevent a sudo user from seeing other sudo user's data?
I'm new to Linux (Ubuntu if that matters). My company has several sudo users on a machine. The situation is like this:
Everyone wants sudo user privilege because they claim they need to install ...
0
votes
0
answers
598
views
Trying to run a Python script as sudo with Windows interpreter inside WSL, but got "file not found"
I have a python script in my WSL Debian called pasman, which is in my home directory bin folder, where I keep my custom scripts. I have an export statement in .bashrc file so that I can run this ...
1
vote
1
answer
1k
views
sudo without changing $USER or whoami
sudo whoami returns root.
How do you change the argument so that you run whoami with elevated privileges, without changing the user? (What is expected to print is the current user, not root, but with ...
1
vote
1
answer
164
views
How do I find ‘foo’ on an external USB drive?
Somewhere on my USB drive is a lost file with the string “foo” in it. I want to recover this using terminal on my MacBook Pro. Using sudo as super user I am able to list expected directories with a ...
2
votes
0
answers
158
views
Why is sudo required for almost anything? [closed]
Whenever I use git to clone stuff or use ssh-keygen I have to use sudo for some reason. I mainly used Git Bash for doing such things on Windows and you don't have to use sudo to do such actions. Is ...
0
votes
1
answer
1k
views
How to su into another user and run commands with subsequent interactive shell
My goal is to su into user2, run commands that reference user1's environment, and also initiate an interactive shell as user2. I'm trying to create a function that allows me to keep forwarding X after ...
0
votes
1
answer
939
views
sudoers sudoedit recursive wildcard
I want to allow editing any file (recursively) under specific directory via sudoers.
None of the below works (Debian 9 sudo)
ops ALL=(root) NOPASSWD: sudoedit /opt/myapps/
ops ALL=(root) NOPASSWD: ...
0
votes
2
answers
683
views
Injecting sudo su with aliases
I'm wondering if there is a way to inject alias when you switch to root profile with sudo.
What I have in mind is this:
sshLogin@linuxVM /home/sshLoginUser/> sudo su -x "alias goHome='cd /home/...
0
votes
1
answer
466
views
UBUNTU Dependency missing Error return Code(1) when running sudo apt-get command
Getting below error when installing anything via sudo apt-get install or using any sudo apt command,My ubuntu version is 18.04.3LTS
s for libc-bin (2.27-3ubuntu1) ...
Errors were encountered while ...
3
votes
1
answer
2k
views
Running programs with sudo gives Invalid MIT-MAGIC-COOKIE-1 keyCannot open display:
I'm trying to run pcmanfm with root privileges, but I keep getting the error:
Invalid MIT-MAGIC-COOKIE-1 keyCannot open display:
I saw somebody suggest export DISPLAY=desktop:0, but that gives me ...
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
2
answers
3k
views
fix sudo access on Google Cloud Ubuntu 18 instance
I edited /etc/sudoers.d/google_sudoers and /etc/sudoers.d/90-cloud-init-users to remove password free sudo access. I use SSH access keys to log in and (apparently) I don't know the login password. ...