Skip to main content

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.

Filter by
Sorted by
Tagged with
3 votes
1 answer
104 views

Change Window Title When Start PowerShell with Sudo.exe

I tried starting powershell with Sudo for Windows from CMD or Batch. Works fine. A PowerShell window opens with administrator rights: rem CMD/BAT sudo.exe start powershell.exe Then, I tried adding a ...
Mr.Key7's user avatar
  • 813
1 vote
1 answer
34 views

Is it safe to do "snap install" with sudo

I am a root user on a workstation; I give access to others on this system. They are requesting me to install: sudo snap install google-cloud-cli An experienced friend of mine had earlier suggested to ...
user984260's user avatar
0 votes
0 answers
22 views

How to properly create a useable disk image for Virtual box?

I can create the disk image of a bootable Linux HDD by using sudo, but then it fails to boot in VirtualBox. My steps are as follows: dd if=/dev/sde of=sda.img bs=1024 conv=noerror,sync VBoxManage ...
Guy's user avatar
  • 51
0 votes
1 answer
37 views

Is this missing library something I can install without sudo privileges?

OS I'm using a CentOS 7 system, which like a red hat system from what I observe (relevant further down the post.) cat /etc/*-release CentOS Linux release 7.8.2003 (Core) NAME="CentOS Linux" ...
Mah Neh's user avatar
  • 33
0 votes
1 answer
95 views

sudo user input sanitize, to avoid error "bash: Invalid option" or "sh: Invalid option"

I'm using sudo from bash to execute an arbitrary wild command as a specific user. This works perfectly in general cases: sudo --login --user=maria -- "$COMMAND" For example, this calls the ...
Valerio Bozz's user avatar
0 votes
1 answer
105 views

give <user> the same permissions as root using sudo [duplicate]

To do this, I seem to have two options: add (user) to the sudo Group: # usermod -aG sudo <user> add (user) to /etc/sudoers # visudo /etc/sudoers ......... <user> ALL=(ALL:ALL) ALL .... ...
mazda's user avatar
  • 177
1 vote
0 answers
61 views

How to let root use sudoedit as if it was a user?

I'm writing a wrapper for myself around vim that detects when the user's trying to edit a file that doesn't belong to them, and suggests sudoedit or visudo instead. I want to use sudoedit rather than ...
aaaalz's user avatar
  • 11
0 votes
0 answers
17 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 ...
PatS's user avatar
  • 465
0 votes
0 answers
39 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 ...
Anonymous's user avatar
0 votes
0 answers
26 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 ...
Excalibur's user avatar
  • 131
-1 votes
1 answer
87 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 ...
jd4u's user avatar
  • 107
1 vote
1 answer
62 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',...
Ciro García's user avatar
0 votes
0 answers
171 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 ...
crimson-egret's user avatar
0 votes
0 answers
26 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 ...
xpt's user avatar
  • 8,781
0 votes
0 answers
57 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 ...
Prithvi Boinpally's user avatar
0 votes
1 answer
183 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 &...
Codename K's user avatar
-2 votes
3 answers
150 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 ...
Tindra's user avatar
  • 1
2 votes
1 answer
887 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 ...
Top Banana's user avatar
0 votes
3 answers
837 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 ...
stucklucky's user avatar
0 votes
2 answers
176 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 ...
hanshenrik's user avatar
  • 1,725
0 votes
0 answers
388 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 &...
gazm2k5's user avatar
  • 101
0 votes
2 answers
248 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/...
Daviid's user avatar
  • 118
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*** &...
Slartibartfast's user avatar
0 votes
0 answers
57 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 ...
lafunbug's user avatar
1 vote
0 answers
192 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 ...
Steven Teters's user avatar
0 votes
2 answers
5k 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 ...
37buEr's user avatar
  • 1
0 votes
0 answers
63 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 ...
joseph22's user avatar
  • 367
0 votes
1 answer
333 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 ...
AndromedaZdna's user avatar
0 votes
0 answers
163 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 ...
meatballbeam's user avatar
0 votes
0 answers
78 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 ==> /...
XM Zg's user avatar
  • 1
0 votes
2 answers
8k 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 ...
Parker's user avatar
  • 1
0 votes
0 answers
68 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 ...
Kağan Aytekin's user avatar
0 votes
1 answer
162 views

Trigger a ZSH function when a command calls for sudo password

I quite often run into a situation where a long running system upgrade gets stuck on getting a sudo password, most often because the time for the last input has expired and I simply forgot about the ...
radrow's user avatar
  • 143
0 votes
0 answers
229 views

Using ctr run gives error on starting a container

I am starting a container using the docker run command, it works fine. However when I try to start the same container using ctr command (irrespective of whatever snapshotter I use) I get this error: ...
Mithilesh's user avatar
0 votes
0 answers
355 views

Ansible not able to execute command with sudo privileges, but the command work when launched manually

I'm kinda stuck on this: I'm trying to automate some task on a target MacOS machine, but the commands that need sudo work only when launched manually, and not with Ansible. An example of a pretty ...
MonsieurMemons's user avatar
1 vote
0 answers
242 views

Can't use `su` anymore nor use `sudo` after using `sudo apt-get upgrade` (Debian)

I'm having an issue right now. To set the scene : I'm currently working on a V2 for a Rails project, with more recent versions, gems, features etc, working with Nginx and Docker. In order to make it ...
Matthieu CORMELIER's user avatar
0 votes
1 answer
624 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....
user1803282's user avatar
0 votes
0 answers
921 views

Ubuntu password no longer works after login

I recently installed Ubuntu 22.04 on a laptop and something weird happened to my password. I can only use it to login when I select a user (the booting GUI) and after that, things like sudo or ...
I.D.M's user avatar
  • 1
0 votes
0 answers
1k views

How to use sudo with sftp through winSCP?

I found a few sources stating that I can use SFTP with a sudo user through an SFTP client (specifically winSCP). This link outlines all the steps I need to take, and it's still not working (https://...
Warsame's user avatar
0 votes
0 answers
317 views

Debian 11: no root access anymore

After trying to reinstall my amd-gpu-drivers, my system rebooted into CLI. So I tried to reinstall GUI with "apt install task-gnome-desktop". After this my system says sudo is an unknown ...
wanna_b_noob's user avatar
1 vote
0 answers
921 views

How do I allow X11 forwarding in root (or with sudo) when accessing Raspberry Pi via SSH?

I have been able to forward X11 through normal executions (e.g. xeyes as opposed to sudo xeyes), but with my purposes I need to access the same applications with root access. I have not been able to ...
Jimmy Bungalo's user avatar
2 votes
0 answers
133 views

Running android avdmanager with sudo

I am running avdmanager create avd from my python script that I start with sudo -E to make my script be able to do priveldged stuff. But for some reason avdmanager created AVD inside /root/.android/...
Euler-Maskerony's user avatar
0 votes
1 answer
803 views

how to stop apache2 via kill -9

I know the normal method to start or stop apache2 on linux is: sudo /etc/init.d/apache2 start|stop Or… sudo service apache2 start|stop Or… sudo systemctl start|stop apache2 But, in an emergency, I ...
acgbox's user avatar
  • 785
1 vote
1 answer
622 views

Running updatedb as a nomal user (using the plocate package)

I want a normal user to be able to update the database used by the locate command in Linux. With the previous version of locate (provided by the package mlocate), I achieved this by adding the ...
scaramouche's user avatar
0 votes
1 answer
435 views

macOS: pkill a specific process without sudo?

Because of some recent bluetooth issues, I need to be able to run sudo pkill bluetoothd quite frequently, so I decided to create a shell script Shortcut to have on my menu bar for quick access. I ...
Arber's user avatar
  • 13
1 vote
0 answers
2k views

Kali apt-get update fails with "Clearsigned file isn't valid"

I'm trying to do apt-get update at in result i am getting these errors, tried various methods, couldnt resolve. i need help with this error. Get:1 http://http.kali.org/kali kali-rolling InRelease [18....
Ravi's user avatar
  • 11
0 votes
1 answer
2k views

Terminal not asking for password while using sudo

Yesterday I was trying to install larbs installation on a different user. It did not work and I had to delete the other user. When I came back to my admin user I realised that it was not asking for my ...
Axel Fire's user avatar
1 vote
0 answers
143 views

Run bundle with sudo in MacOS .app bundle

I have a MacOS app that I want to deploy as .app bundle. The binary in this bundle is needed to run with root priveleges. I made launcher zsh script in Contents/MacOS with line sudo ./MyApp. I changed ...
SliFF's user avatar
  • 21
0 votes
0 answers
144 views

Default path for RScript terminal command changes with sudo

I am trying to execute Rscripts from the terminal, but I can only get them to work by adding the sudocommand. Running --verbose, I have been able to narrow down the problem to a difference in the ...
HarD's user avatar
  • 101
1 vote
1 answer
753 views

How to correct sudo fatal error on Ubuntu after wrong permissions given?

I made a mistake giving wrong permissions on folders (chown I think on the wrong folder) when using wsl and ubuntu. Now I have the following errors when I launch Ubuntu. I really don't know what to do:...
jos97's user avatar
  • 113

1
2 3 4 5
23