Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [sudo]

Questions related to the sudo command that allows users to run programs with the privileges of a different user (normally the root user).

0
votes
0answers
27 views

Restrict the use of su

I've restricted the use of su by creating an admin group sudo groupadd admin sudo usermod -a -G admin <YOUR ADMIN USERNAME> sudo dpkg-statoverride --update --add root admin 4750 /bin/su I've ...
0
votes
0answers
28 views

Not able to switch to root using sudo su and su command [duplicate]

Not able to switch to root using sudo su and su command: user@user-HP-Pro-3330-MT:/$ sudo su The program 'sudo' can be found in the following packages: * sudo * sudo-ldap Try: sudo apt install <...
0
votes
0answers
42 views

Sudo and Su command not working

when trying to switch root using sudo su Error- sudo is not installed When trying to switch through su command error- this program is not installed what to do,please help NAME="Ubuntu" VERSION="...
1
vote
1answer
76 views

Make a file with root access only and able to be accessed by another file without using a password

I have two files A and B. I need the contents of A to be accessible only by root, so I have run the command chmod 000 A. Now, I want file B to be able to access file A without asking for the root ...
0
votes
0answers
35 views

run shell script as other user, but directory stay the same

I have to run a bash script as root. But in this script, there are commands that I have to run as my normal user (he's named "ubuntu"), but when doing it I don't want the current working directory to ...
0
votes
1answer
25 views

Sudo not working for chmod

I am trying to install a piece of software on a clean AWS instance. It requires changing permissions on a bunch of files. The first batch goes ok after sudo chmod 644 config.local.php sudo chmod -...
0
votes
0answers
22 views

How to get remote script to execute through sudo via expect script [on hold]

I've seen a number of other posts that are so tantalizingly close to my issue; but I still can't get this to work. I want to be able to run ssh into a server, sudo to another account and then run ...
0
votes
0answers
15 views

“sudo” command doesn't work anymore [duplicate]

I tried to run this command: sudo nano /etc/sudoers I got this error >>> /etc/sudoers.d/grader: syntax error near line 1 <<< sudo: parse error in en_US.UTF-8 near line 1 sudo: no ...
0
votes
1answer
306 views

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)

I'm trying to run this command in the terminal: sudo apt install software-properties-common This is the error message I get: E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource ...
-1
votes
0answers
20 views

when i try to install sudo apt-get install android-tools-adb [duplicate]

i get error like the one below E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend),...
2
votes
4answers
348 views

How to allow a command to be executed for a particular user without password with sudoers file?

Can anyone please explain the exact work of these in /etc/sudoers ? (I've done some research, so please don't share any links) I want to add myself (member of sudo) to execute a command without ...
0
votes
0answers
43 views

sudo command sudo: /etc/sudoers is world writable sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin

I have run this command by mistake chmod -R 777 ./* Now not able to use sudo and can't open folders as root. sudo: /etc/sudoers is world writable sudo: no valid sudoers sources found, quitting sudo: ...
0
votes
0answers
55 views

add-apt-repository command not working [duplicate]

I'm new to Ubuntu and I tried to install something and the guide I was reading says to run a command that starts with sudo add-apt-repository but whenever I try to use the command then it says bash:...
1
vote
1answer
89 views

How to solve this error `sudo: /usr/local/bin/sudo must be owned by uid 0 and have the setuid bit set` without reinstalling ubuntu?

TLDR: I am running Ubuntu 18.04 with i3 and I messed up my permissions. Whenever I run a command with sudo, I get this error message, sudo: /usr/local/bin/sudo must be owned by uid 0 and have the ...
1
vote
2answers
108 views

Removing rstudio and its user from the system

I installed rstudio on my system, but I don't need it now. It has created its own user. Whenever I turn my system on, two users appear on the screen. This has happened only after installing rstudio. I ...
2
votes
1answer
141 views

sh sudo string parameter

I'm playing with my Raspberry Pi Zero, and I'm trying to automate an FM transmitter script. You can run the script with sudo fm_transmitter -f [frequency] -r [.wav music file] For example: sudo ...
0
votes
1answer
30 views

Can't modify files in a directory even with root

While following this answer: https://askubuntu.com/a/715310 I ran the command: sudo ln -s /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/amdgpu_bl0/brightness /sys/class/backlight and ...
0
votes
0answers
40 views

System user without login and password but only allow sudo for one user

I'm currently trying to set up a system user on my Ubuntu 18.04.1 LTS server to run a specific service from its home directory and be used with sudo -u USER to execute a command sometimes. I've ...
1
vote
1answer
22 views

Can I edit the sudoers file with visudo using my bootable USB

Something I did with a sudo dpkg ... installation in an attempt to fix problems with my audio clobbered my ability of my sole user-name to run sudo in 18.04 LTS (Bionic Beaver). This is a single OS ...
1
vote
1answer
73 views

Running programs as sudo doesn't work

Installing tools and other using command line in Ubuntu 18.04 with sudo works perfectly. example: sudo apt install ... works perfectly. Running tools and programs via the command line as sudo doesn't ...
1
vote
0answers
70 views

Running any sudo command produces strange output

Looks that some script executes every time I run sudo command on my Ubuntu: sudo apt update mmap: Invalid argument munmap: Invalid argument munmap: Invalid argument munmap: Invalid argument munmap: ...
0
votes
1answer
18 views

Install of lbdvd hangs

In Ubuntu 18.04 I was installing lbdvd by running sudo apt install libdvdcss2 libdvdread4 libdvdnav4. Ubuntu has been setting it for over an hour hung at this screen If you acquired this product ...
0
votes
1answer
39 views

Mount an external hard drive with full ownership and permissions (sudo or root)

For an external hard drive, I'm getting a message that I don't have permissions. Recursive chmod or chown would involve too many files. Also, while not an issue, let's say, at least for arguments ...
0
votes
0answers
48 views

How to give sudo permission to an application

I'm trying to use gitkraken application but when i try to open a github repository in /var/www directory it gives me Error opening directory '/var': Permission deniederror. I tried to give sudo ...
0
votes
2answers
54 views

Can't run visudo within Docker; sudoers file does not exist

Ubuntu n00b here. I am tinkering with a Docker container that I created using the following simple Dockerfile: FROM ubuntu CMD ["tail","-f","/dev/null"] Inside the container, as the root user, I try ...
36
votes
3answers
6k views

After accidentally renaming /etc, how do I rename it back?

I'm using Ubuntu 18.04. I renamed the /etc folder to apache2. That was my greatest mistake Now I can't rename it back because I need to use sudo, but when I try I get the error sudo: unknown uid ...
0
votes
0answers
27 views

Cannot use OVS commands with libvirt

I have an Ubuntu 18.04 on which I have installed OVS. I have created a bridge 'br1', and the output of $sudo ovs-vsctl show Bridge "br1" Port "enp0s25" Interface "enp0s25" Port "...
0
votes
0answers
18 views

CHOWN command applied on /usr/lib by mistake [duplicate]

By mistake, I executed below commands sudo chown -R $USER /usr/lib So now it seems /usr/lib ownership is changed and sudo command is not working. Getting following error on terminal sudo: error ...
0
votes
0answers
35 views

ruby works for normal users but not for root

I have an ubuntu 18.04 machine with ruby installed. I login with a user that is part of the www-data group and I am able to execute this: ruby myprogram.rb without any issue If I try to do sudo ...
0
votes
0answers
30 views

How can I fix broken sudo - sudo: parse error in /etc/sudoers near line 1 [duplicate]

I am a newbie to Ubuntu I tried to get rid off from asking password every time so I changed some line in sudoers file now I am stuck. How can I solve this?
1
vote
1answer
53 views

I have somehow locked or removed my access to sudo - how can I fix it? [duplicate]

I am fairly new at Ubuntu system and commands. I was trying to follow some tutorial online explaining how to setup using no password to download apps. I was in visudo, and next thing I know I can't ...
0
votes
0answers
142 views

Snap application Heroku dropping privs did not work

When executing the command heroku after installing via snap, it throws the error dropping privs did not work: cesar@pc:~$ heroku --version dropping privs did not work But if I execute sudo heroku ...
0
votes
1answer
44 views

Can't use sudo and couldn't access root user to fix it after running chmod -R 777 /usr/ [duplicate]

I used these commands to allow access to git clone katoolin to be stored in usr sudo chmod -R 777 /usr/ sudo chown www-data:www-data /usr/ I don't know which one ruined my sudo access. Also, I don't ...
1
vote
1answer
104 views

Why does AWS's Ubuntu AMI come with an “ubuntu” user instead of just allowing root login? [duplicate]

AWS's Ubuntu image gets bootstrapped with your credentials being added to a user called ubuntu. After the machine comes up, you can SSH into your new box with the ubuntu user. This user is a sudoer, ...
1
vote
1answer
68 views

Execute sudo Bash script as another user while being root

I am logged in as root and want to execute a Bash script with sudo permissions as another user. This is the test Bash script in /home/me/sudo.bash: mkdir -p /etc/test # Creating an /etc directory to ...
-1
votes
1answer
92 views

i can't install sudo [closed]

I want to install sudo so I typed command apt-get update then it shows the following error: reading packages lists...done W: chmod 0700 of directory /var/lib/apt/lists/partial failed - E: could not ...
1
vote
1answer
123 views

How to setup a systemd service with root access?

Description I am trying to make a systemd service file to run a python script to print something using thermal printer. escpos is the library I am using to access the control of thermal printer. ...
0
votes
1answer
47 views

Local Workspaces Permissions Management and GitHub Integration

I have a folder ~/workspaces where I place all my local repositories from GitHub and other coding projects. I use VS Code and have had permissions problems since I installed Ubuntu a month ago. I ...
1
vote
3answers
113 views

Why can I not su to root?

I used sudo passwd root to set root's password successfully, then I tried to su to root, but it failed with no response. ubuntu@VM-44-117-ubuntu:~$ sudo su root ubuntu@VM-44-117-ubuntu:~$ You can ...
1
vote
0answers
11 views

localhost error [duplicate]

I changed ISP. My internet works fine, but I get this error when I run a sudo command in terminal: sudo: unable to resolve host localhost.localdomain How do I fix this error?
0
votes
0answers
18 views

dependency, sudo, and apt-get errors in Kubuntu

It's been awhile since I've used my Kubuntu system. I'm trying to upgrade to version 16.04 - and running into a series of problems: 1) When attempting to upgrade Kubuntu to version 16.04, I get the ...
0
votes
3answers
180 views

What is a sudo password? [duplicate]

I am prompted for a sudo password. Since I am a user at a very basic level of knowledge, I am very shaky in getting to the terminal and/or using the commands. When I am told to take the step "enter ...
0
votes
0answers
30 views

monitor service user account activity

I've a service account that has a full root access "user1 All=(ALL:ALL) NOPASSWD:ALL" . The user account is not used by a human user but it is used by an application which is running some bash and ...
0
votes
0answers
22 views

Incorrectly created file in /etc/sudoers.d file with visudo, but broke things [duplicate]

I tried to do what I thought the comments in /etc/sudoers was telling me: # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ ...
0
votes
0answers
29 views

sudo update-alternatives,why? [duplicate]

I came across these two commands sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/bin/java sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac Why ...
0
votes
3answers
100 views

What is the difference between sudo and sudo -H? [duplicate]

Sometimes I see in many websites' tutorials the use of sudo -H + command for example sudo -H gedit /etc/apt/sources.list. However I know that sudo gedit /etc/apt/sources.list can do the work. So ...
0
votes
0answers
41 views

pam_tally2 in Ubuntu 16

I have an issue getting pam_tally2 to work correctly on Ubuntu 16. I am using the default common-auth, common-account, and common-password. My Ubuntu 16 is patched to the latest patches. My OS must be ...
0
votes
0answers
79 views

Ubuntu 18.04 VM; unable to initialize PAM: No such file or directory

I'm trying to learn more about Unix systems, and am working on hardening an Ubuntu Server VM (using VMWare Workstation). In the process of which, I must have done something that messed with the pam ...
24
votes
6answers
4k views

Is Vim safe to use in combination with sudo?

It is not advisable to use sudo with a graphical application like gedit, as described at this link. Accordingly, I have tended to use vim with sudo. Recently I noticed my ~/.viminfo was owned by root ...
0
votes
1answer
31 views

How do I un-screw up a Python/Pip installation after doing the mistake of running sudo pip multiple times?

I did the fatal mistake of using "sudo pip" inside a virtual environment multiple times, and now all my virtual environments are a mess, failing in random ways when I try to install pip packages. I'm ...