Questions tagged [sudo]

The sudo command allows users to run programs with the privileges of a different user (normally the root user). Use this tag for questions related to configuring and using the sudo command.

Filter by
Sorted by
Tagged with
1 vote
1 answer
2k views

How to get the X-Servers complete address

Edited concerning the answer of @terdon. On my ubuntu computer: If I connect a server via ssh -X my_server, then I can start a program. Then I use sudo -i to become root, but I can't start the same ...
Andy A.'s user avatar
  • 133
3 votes
1 answer
5k views

How to solve this GPG error?

When i tries to update and upgrade my apt i get these errors below: Get:1 https://cli.github.com/packages stable InRelease [3 743 B] Hit:2 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease ...
Jonte YH's user avatar
  • 1,943
2 votes
3 answers
30k views

How to fix the "Unit docker.service could not be found." error?

How do I simply pull and run hello-world? nicholas@mordor:~$ nicholas@mordor:~$ nicholas@mordor:~$ snap list docker Name Version Rev Tracking Publisher Notes docker 20.10.14 1779 ...
Nicholas Saunders's user avatar
1 vote
1 answer
182 views

Trying to execute command as root does not set $HOME to /root

Im attempting to run a command as root but it is not working and I think the reason why is because when running the command sudo is not setting $HOME to /root but keeping it as /home/MYUSER the ...
TheQAGuy's user avatar
  • 113
2 votes
1 answer
430 views

sudo with a USERID - reverting old behaviour

In my systems running Ubuntu 18.04 I can run a command (as root) like sudo -u \#2000 echo hi And this works to run the command as UID 2000, even though uid 2000 does not exist in the passwd file. ...
davidgo's user avatar
  • 117
0 votes
0 answers
226 views

How can I emulate a sudo shell with the respective environment variables set when using "sudo su -c "<command>"?

I would like to run a sudo command in one line, but also have this command be run as a sudo user with all the respective environment variables instantiated (essentially run exec zsh before anything). ...
Yes's user avatar
  • 101
5 votes
4 answers
4k views

Why sudo can't find a command that normal user can?

A while ago I was installing NPM and I noticed that when I tried to run their install shell script using sudo it threw errors regarding some commands not being found. However when trying to run the ...
andresantacruz's user avatar
0 votes
0 answers
79 views

Migrating ownership from macos

I switched from Macos to Ubuntu, now I am trying to own my mac homefolder with Ubuntu. I thought to be smart and use the same username (ruut) and password for the new account and homefolder, but that ...
Ruut's user avatar
  • 1
0 votes
2 answers
3k views

How do I run a service as a non-root user at boot, without entering a password?

I have a process that I want to start when the host boots. I want that process to run as a non-root user. And I won't necessarily be around to enter a password on the tty when it starts. Here's my ...
Eliot's user avatar
  • 197
0 votes
2 answers
2k views

How do I configure sudo in 22.04 for AD group access?

I have configured sudo access in previous versions of Ubuntu for AD groups. In 22.04 I get error that user in AD group is not in sudoers file. I inserted the line %gg_adm_server ALL=(ALL) ALL in ...
joerabbi's user avatar
  • 129
0 votes
0 answers
955 views

run script in cron job that contains sudo

I need to write a script that will restart the DB server and run the application I know how to write the script and how to make it in crontab to run after a reboot my problem that I need to do some ...
Amira Elsayed Ismail's user avatar
0 votes
0 answers
24 views

Sudo options question [duplicate]

I need to run a command that requires sudo to run and I want to run it in crontab -e the command is sudo java -jar WurmMapGen.jar but it asks for a password. I want this to be an automatic ...
jpoblocki77's user avatar
-5 votes
1 answer
209 views

Best Practice for Always Logging Into Root [duplicate]

The answer in How to solve "permission denied" when using sudo with redirection in Bash? says to use "sudo -i". Is this always going to make sure I have write permissions for every ...
Frustrated's user avatar
0 votes
0 answers
33 views

Why is my terminal rejecting my sudo command as permission denied [duplicate]

sudo gresource extract gtk.gresource \ /usr/share/themes/MyCustomTheme19929/gtk-3.0/gtkgresource \ >/usr/share/themes/MyCustomTheme19929/gtk-3.0/what.css bash: /usr/share/themes/...
Frustrated's user avatar
2 votes
1 answer
635 views

When I run sudo -i or sudo su I get an error

Error when running sudo su: su: failed to execute /bi: No such file or directory Error when running sudo -i: sudo: /bi: command not found How do I fix this error?
FFmpegEnthusiast's user avatar
0 votes
0 answers
208 views

user lost sudo permissions after sudo password update

I am using Ubuntu 22.04 LTS and I no longer can run any command with sudo. When logged in from terminal, I have verified that I am in the sudo group. jianwu@localhost:/usr/bin$ sudo whoami root If I ...
jxw's user avatar
  • 143
0 votes
1 answer
84 views

I have lost my superuser rights for installation. What can I do now? [duplicate]

I've recently started using Ubuntu on my old laptop and I actually really like this OS, but somehow I've lost my superuser rights and idk how and why. As you can see in the screenshot, I've already ...
Slotski's user avatar
  • 11
0 votes
2 answers
57 views

Restricted sudo access for support staff

We have some L1 support staff who need to manage user accounts, etc. but we'd prefer to restrict them from having full sudo access. Is that practical? I wasn't able to find any useful in Google or ...
Luke's user avatar
  • 1
0 votes
1 answer
761 views

In Ubuntu 22.04- how do I issue my password in a startup application that requires a sudo?

I have a couple of network folders in other linux machines on my CIFS network. I've set them in FSTAB and they are accessed OK, PROVIDING I do a sudo mount -a when the system is restarted. I've ...
aqk's user avatar
  • 301
0 votes
0 answers
41 views

su and sudo commond could not work

apt install and update commands need the read and write of root or administrators. but it does not work now. $ sudo sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set $ su ...
CY Zhung's user avatar
0 votes
0 answers
455 views

build docker image with or without sudo?

I have a really simple doubt but could not find an exhaustive answer anywhere. When I build a docker image is it a good practice to build it with sudo? If yes, why? and why not? i.e. should I do: sudo ...
desmond13's user avatar
  • 704
0 votes
2 answers
128 views

Prevent one user to get into other user's data

I have two users in the home directory (home/user1 and home/user2). I want them all to have all permissions but I don't want the second one to access data from user1. Both can read and install ...
Developing Electronics's user avatar
0 votes
0 answers
906 views

Ubuntu 18.04 sudo apt update error + internet connection problem

I'm trying to install Ubuntu 18.04 on my M1 via a virtual machine called UTM. The problem is that there is "no wifi adaptor found" in my ubuntu, so I'm trying to run sudo apt update , but I ...
Tro's user avatar
  • 11
-1 votes
2 answers
739 views

running systemctl via ssh without asking for password

I want to run ssh without asking for password and invoke systemctl without password i tried doing the following: ssh -t <user>@<host> "echo <password> | sudo -S systemctl status ...
Daniel's user avatar
  • 11
0 votes
1 answer
473 views

Domain Group Not able to Sudo

I am facing an issue with sudo for AD group users. I have added following lines to /etc/sudoers file using visudo %domain\ admins ALL=(ALL:ALL) ALL ----- (This Works) %domain\ Users ALL=(ALL:...
Ahsan's user avatar
  • 1
2 votes
1 answer
8k views

steam is not in the sudoers file error when Installing steamcmd on fresh ubuntu server 22.04 LTS

While attempting to setup a valheim dedicated server on Ubuntu 22.04 LTS (GNU/Linux 5.15.0-39-generic x86_64) I am trying to run these instructions to install steamcmd: Create a user account named ...
MisterWhite's user avatar
0 votes
0 answers
30 views

Sudo commands take to long to execute after run VPNC

I'm using VPNC to connect to my company's vpn, and after start the .conf all the sudo commands on ubuntu 20.04 become slower, kill (or deactivate) the vpnc process solve this problem.
Mateus J.S's user avatar
0 votes
1 answer
109 views

How to make unaccessible /root/ directory for other admin users?

By using sudo command, other admin users can get access to the /root/ directory, using their credentials. How to make it impossible ?
curioushuman's user avatar
0 votes
1 answer
80 views

Git pull and vpn asking for old root password

I changed the system password recently. Whenever I am trying to do a git pull or a vpn connection, I am asked for the "previous" Ubuntu password. May I know why this is happening?
SKPS's user avatar
  • 183
3 votes
1 answer
2k views

systemctl still asking for password even with sudoers

My /etc/sudoers josh ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart servicename.service running systemctl restart servicename.service still asks for password. Does anyone have any ideas? Running ...
Josh's user avatar
  • 95
0 votes
0 answers
33 views

sudo apt update problem [duplicate]

valenton@valenton:~$ sudo apt update E: Conflicting values set for option Signed-By regarding source https://dl.winehq.org/wine-builds/ubuntu/ jammy: /usr/share/keyrings/winehq-archive.key != /usr/...
Valenton Fernandes's user avatar
0 votes
1 answer
1k views

Why does `sudo gnome-text-editor` throw GLib-GIO-CRITICAL error?

Whenever I try to launch a system file to edit it using sudo gnome-text-editor, I get the error (gnome-text-editor:64141): GLib-GIO-CRITICAL **: 17:47:31.731: g_dbus_connection_emit_signal: assertion '...
Mark Smith's user avatar
2 votes
1 answer
4k views

`sudo` command isn't working in Ubuntu 20.04

I need to install pymol on Ubuntu 20.04 and when I am using sudo apt-get install -y pymol it gives an error: username isn't in the sudoers file. This incident will be reported. Does anyone know how to ...
Misbah naseem's user avatar
0 votes
0 answers
33 views

Crontab will not perform any tasks

I have a python file that has to be run with sudo elevation every 6 hours. I created the cronjob using sudo crontab -e and then added the entry: 0 */6 * * * cd /home/timeflow/backup && sudo /...
chxnge's user avatar
  • 1
1 vote
1 answer
11k views

sudo tasksel install ubuntu-desktop doesn't work

After I type this command and the password nothing happens.
Ido Tuvia's user avatar
4 votes
1 answer
4k views

Is it a good thing to run virt-manager as sudo?

I just installed qemu-kvm and virt-manager. But when i run virt-manager by clicking the icon it is not connecting to kvm. But when i run $ sudo virt-manager KVM connects. i've been told that running ...
user avatar
2 votes
0 answers
688 views

E: Package 'hibernate' has no installation candidate [duplicate]

Goal: To follow this answer. I've tried with no difference made: sudo apt update sudo apt-get update (base) me@ubuntu-pcs:~$ sudo apt install pm-utils hibernate Reading package lists... Done Building ...
StressedBoi_69420's user avatar
0 votes
2 answers
900 views

I Accidentally deleted my /etc/sudoers file

I have no backup. I'm incredibly unknowledgeable, so if anyone could give a beginners guide to this issue that would be amazing this is the error that is displayed when using any sudo commands : sudo: ...
Nathan's user avatar
  • 1
0 votes
0 answers
28 views

Sudo: /etc/sudo.conf is world writable [duplicate]

I used chown -R 777 / and now i cant open Firefox and root account How can i fix it? Im a newbie btw
sepas's user avatar
  • 9
-1 votes
1 answer
788 views

Can't Open `nautilus`

I opened nautilus using $ sudo nautilus / and deleted some files at /usr/share (Discord related files) but after that i tried to open nautilus by clicking the icon and it don't open. i got no idea ...
user avatar
1 vote
1 answer
358 views

Broken ubuntu after sudo apt dist-upgrade?

I was trying to install PHP on my Ubuntu and did a sudo apt dist-upgrade without seeing what was gonna be changed. After that I suddenly couldn't access settings, files or connect to internet they ...
Enzo Massaki's user avatar
0 votes
1 answer
153 views

Your authentication attempt was unsuccessful (for sudoer)

After installing Ubuntu I have created a new user and gave it all privileges in /etc/sudoers: user2 ALL=(ALL:ALL) ALL However now user2 cannot do admin tasks from GUI, like formatting a disk ...
blnks's user avatar
  • 642
0 votes
0 answers
21 views

libopenmpt-modplug1:amd64 [duplicate]

dpkg: unrecoverable fatal error, aborting: files list file for package 'libopenmpt-modplug1:amd64' is missing final newline E: Sub-process /usr/bin/dpkg returned an error code (2) How can I fix this. ...
Golam Rafi's user avatar
0 votes
0 answers
66 views

Is running a browser as group via sudo dangerous?

Suppose that internet is a group I have created. Is it dangerous to run e.g. Firefox via sudo -g internet firefox? I am 99% sure it's not, but wanted to make sure since I am doing that often and I ...
DeapSoup's user avatar
0 votes
1 answer
357 views

Error, when I go the the root sudo -s

New to Linux. I'm using: uname -r 5.15.0-30-generic lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04 LTS Release: 22.04 Codename: jammy First I ...
zf73's user avatar
  • 3
0 votes
3 answers
1k views

Vim is opening with Vi when I use Sudo - why?

I use neovim. I changed my .zshrc to open nvim when I type vim in the terminal. My configuration is from my Mac where I didn't use Sudo much (now I use Ubuntu, I use sudo all the time). When I do sudo ...
Vinn's user avatar
  • 123
1 vote
1 answer
3k views

User in sudo group can't use sudo in Ubuntu 20.04

I'm currently facing a problem when I use my sudo permission. I understand somebody faced this problem before, e.g this question, and followed some steps to resolve but unsuccessful. FYI, before I can ...
Bryan's user avatar
  • 200
2 votes
2 answers
707 views

Why can't I paste multiple sudo commands in Ubuntu 22.04?

I just installed Ubuntu Server 22.04 and SSHed in. I'm not able to paste multiple sudo commands as I could with Ubuntu Server 20.04. This feels to me like a security feature that I don't want. ...
aswine's user avatar
  • 227
0 votes
0 answers
1k views

xhost: unable to open display ""

I'm trying to use the -S method to run a sudo command user@vmi804792:~$ echo ***** | sudo -S -v But I get this error: ***** [sudo] password for user: Error: Can't open display: unix:0 sudo: no ...
cool  mann's user avatar
-1 votes
1 answer
510 views

Do you need to update VLC first before installation? [closed]

I am trying to use commands to update or install VLC on Linux. I am trying to use sudo apt install vlc or sudo apt update vlc but these commands seem like they are not working.
Beginner Again's user avatar

1
3 4
5
6 7
58