sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

1
vote
2answers
30 views

Reason for requirement for root for package management

In package managers like pacman and apt, the root check is hard coded into source using guid checks. Why is this? A non privileged user can compile a program - let's say chromium browser - from ...
0
votes
1answer
20 views

To wget as New User without sudo in Raspbian

I have a new user masi in Raspbian Jessie. I want that it has access to /usr/bin/ etc wget. I did sudo adduser masi sudo visudo root ALL=(ALL:ALL) ALL masi ALL= NOPASSWD: ALL % ...
0
votes
1answer
5 views

Failed to syncronize cache for repo 'fedora' … (possible proxy issues)

I just started on a fedora build. Just managed to add myself to the sudoers file, so now I am attempting to grab vim. I do a sudo dnf install vim and get hit with the following error message. ...
0
votes
1answer
17 views

How do I edit sudoers file in fedora? [duplicate]

I have just started a new fedora build. I just got things going, and was about to install tmux, and was hit with the message... Error: This command has to be run under the root user Ok. I attempt ...
0
votes
1answer
28 views

Is it safe to uninstall `su` in favor of `sudo` to harden Arch Linux? [on hold]

Is it safe to uninstall su in favor of sudo to harden Arch Linux? Have you got an opinion on whether this is a good or bad idea? I read the Arch Linux Wiki articles Security, Su and Sudo. I also ...
0
votes
0answers
16 views

alias pip to sudo pip

When using pip I almost always use sudo because otherwise it lacks permissions. I plan on adding an alias pip="sudo pip" in my .zshrc file. Is there a reason I shouldn't do that? The main issue I can ...
1
vote
1answer
29 views

`sudo -u user script` does not even have access to /bin/sleep

When running the script bla with sudo -u otheruser ./bla I get an output indicating that this script is run such that no external commands are available: otheruser ./bla: line 3: /bin/sleep: ...
4
votes
1answer
899 views

How to add myself to sudoers when I have no root access on my debian machine?

I've gotten myself into a weird situation. I just installed Debian on a virtual machine I made so that I can ease into it before I try dual booting. I went through all the set up, and as a test to see ...
0
votes
0answers
15 views

notify-send not showing when executing with sudo [duplicate]

In short: I have a scripting finding, fixing and mounting a partition, thus this needs sudo / su permissions. System: Gnome 16.04 - amd64 notify-send "a message" shows a notification as expected, ...
0
votes
0answers
25 views

Can naming/running a program “sudo” somehow cause problems? [closed]

I hope this is an appropriate place to post this--I have no idea what happened. I named a c++ file (a simple sudoku solver) "sudo.cpp" and then compiled it with "g++ sudo.cpp -o sudo" and ran ...
1
vote
3answers
40 views

Does it make sudo more secure when indexing all commands by their SHA-2 checksums?

I'm asking myself whether system security substantially increases when I generate a security policy, i.e. sudoers file which contains one or more Cmnd_Alias definitions that enumerate all executable ...
0
votes
1answer
27 views

2 factor login for gui and ssh imposes verification for sudo use

tldr: how can I make it so I don't have to use a verification code to sudo? Hello, I followed this guide on how to setup 2 factor login for my debian install. I have it so when you try to login ...
1
vote
1answer
66 views

What to do if the owner of /usr/bin/* changes to a non-root?

It would be the right thing to say that I messed up! Accidentally, I changed the owner of all files in /usr/bin to 'dev' from 'root'. Now, sudo does not work! If I use sudo with any command, I get - ...
2
votes
1answer
31 views

Forwarding X-windows through a su - session

I'm trying to forward my X windows, but seems to be limited to just on session? What I'm trying to do is invoke x-applications as another user, through a sudo su -. If I know the other user's ...
0
votes
3answers
6k views

apt-get update failed to fetch and /sources.list.d/ empty

Running the sudo apt-get update command, I got the following error: Fetched 988 kB in 16s (59,3 kB/s) W: Failed to fetch ...
0
votes
3answers
56 views

I'm a sudoer and also NOT in sudoers file somehow?

I'm trying to run sudo apt-get update. I will paste my last output from me trying to 'add' myself to sudoers file (which I figured I was on, but kept getting errors saying I wasn't...) ...
13
votes
2answers
2k views

How to safely pass variables to root-enabled scripts?

This question is totally general and not only applicable to my situation, but... I have a small busybox appliance where I want a non-root user to be able to execute a particular script with root ...
19
votes
2answers
54k views

su options - running command as another user

I was wondering how to run a command as another user from a script. I have the script's owner set as root. I also have the following command being run within the script to run the command as the ...
0
votes
1answer
13 views

Default audio (Pygame.mixer and alsamixer) doesn't work when using sudo

I have a simple python file which plays a sound: #sound_test.py import pygame #init sounds pygame.mixer.pre_init(44100, 16, 2, 4096) pygame.init() pygame.mixer.init() WAV = ...
0
votes
2answers
73 views

How to get sudo access without reboot? (on remote server) [closed]

(From remote Debian server) When you give sudo right with visudo for the first time on first boot to a new user, su - <newuser> will not be enough to offer the right to use sudo and then reboot ...
4
votes
3answers
9k views

How to run sudo commands remotely via ssh -t?

I have a script that logs into a remote host via ssh -t and uses sudo service foo restart. The requirement is to avoid the prompt for a password on the remote host. The remote host authenticates via ...
0
votes
1answer
37 views

How to forbid ssh connection after sudo -u

After ssh login, user with UserName makes $ sudo -u localusername -i and $ ssh localusername@someserver How to forbid ssh localusername@someserver for UserName via sudo -u localusername but permit it ...
6
votes
1answer
5k views

How do I allow non-root users to control a systemd service with instances?

I need to allow users in the dba group to control the database@ services. The answer to this related question is to just list all systemctl "verbs" that I want to allow in the sudoers file, however, ...
2
votes
0answers
14 views

Override local sudo defaults using sss or ldap

I'm trying to to configure an IPA domain to use the following sudo options for a specific command group: !authenticate !requiretty visiblepw Locally, the following defaults are set in /etc/sudoers: ...
4
votes
3answers
8k views

How can I scp a file that my user can't read but I can sudo?

Can I use scp to copy a file from a remote server which my login user can't read, but where I have permission to sudo to root (without password even)? How?
13
votes
6answers
137k views

Username is not in the sudoers file. This incident will be reported

I am running Ubuntu 12.04 on my laptop using VMware Player. I am not sure why but I have an account called "User Account" in addition to my account that I usually login to use Ubuntu. Well that was ...
5
votes
2answers
20k views

Execute shell script from php, as root user?

Need to execute the following line from PHP: $res = shell_exec('sudo sh /home/nicklas/cronjobs/make_account.sh username password'); The problem is nothing happens on execution. If i try to ...
1
vote
1answer
13 views

Setting nano cursor using mouse via putty doesn't work if sudo

I needed to be able to set the cursor using mouse when editing text via nano over putty. I have already set the below in ~/.nanorc: set mouse If I start nano file just like that then it works, but ...
0
votes
1answer
34 views

su to a specific user only if requesting user is in a specific group

I need to know how to set up a control user that a user can sudo into only if the user is in a certain group. For example, stupid is a control user that interacts with a service, and is in the group ...
25
votes
6answers
4k views

Why is it risky to give sudo vim access to ordinary users?

I'd like to create a new user and give him sudo access. To be specific, I want him to use sudo vim and edit httpd.conf. I wrote this in sudoers: user ALL=(ALL) /usr/bin/vim ...
1
vote
0answers
52 views

Galera + systemd: wsrep_notify_cmd fails with sudo (unable to change to sudoers gid: Operation not permitted)

We have a Galera cluster operational on CentOS 7 with sysv, and are looking into migrating to systemd. We are invoking a wsrep_notify_cmd to notify our application of changes in the node states, and ...
17
votes
2answers
2k views

Can I customize the sudo “this incident will be reported” message?

Is it possible, on Linux or on BSD systems, to customize the sudo "this incident will be reported" message? I've gone over man sudo and man sudoers on an Ubuntu 16.04 machine, a FreeBSD 10.2 machine, ...
2
votes
1answer
43 views

Prevent sudo user access to specific folder and files [duplicate]

How can I restrict sudo access to a specific user in the /var directory or its contents?
7
votes
11answers
34k views

How to log commands within a “sudo su -”?

If I: [user@notebook ~] sudo echo 123456uu 123456uu [user@notebook ~] Then I can see that in the logs: [root@notebook /var/log] grep 123456uu * auth.log:Jan 9 17:01:51 notebook sudo: user : ...
0
votes
0answers
19 views

authenticate commands using pam module

This is weird requirement i am not sure possible or not but we have Centrify running in our environment which use dzdo instead of sudo Now i have requirement to ask password for specific command, do ...
1
vote
1answer
54 views

Does user have to logoff then back on if I change /etc/sudoers?

Redhat Enterprise Linux 5.10 (No we can't upgrade, please don't ask.) I have a user, 'tina' who is logged into the system. I need her and user 'lu' to use chmod, chgrp, and chown commands for certain ...
0
votes
1answer
22 views

Now visudo won't work at all

RHEL 5.10 When I do visudo I get this error: chuck 75->visudo visudo: /etc/sudoers: Permission denied visudo: /etc/sudoers: Permission denied Listing of sudo exe file and /etc/sudoers: chuck ...
2
votes
1answer
136 views

RHEL sudo still not allowed for user 'tina' [duplicate]

I'd like 2 users, 'tina' and 'lu' to execute a few utils like /bin/chmod. Here's the relevant portion of my /etc/sudoers file. tina,lu ALL=/bin/chmod /bin/chown /bin/chgrp Then I logged in as ...
1
vote
1answer
33 views

RHEL How to login as different user from shell?

Redhat Enterprise Linux 5.10 (No we can't upgrade.) This is related to my other question. I would like to be able to login as another user, like 'tina', so I can test her sudoer permissions. My ...
4
votes
1answer
44 views

Unable to get sudo lecture working on CentOS 7 server

I'm trying to enable the sudo lecture every time someone executes sudo, but I can't seem to get it working at all. I found a similar question here, in which someone states that if you don't see any ...
1
vote
0answers
10 views

RH software collections enable for command run with sudo

We are using RH software collections for python34 and have the following in /etc/profile.d/scl_enable_python34.sh source scl_source enable rh-python34 This works perfectly for interactive users. ...
0
votes
1answer
30 views

How to delete password for current account

I just installed Ubuntu 15.10 on my new desktop. However, I want to erase the password of it. I followed the instructions here. I now can successfully login with out password, but I cannot use sudo ...
123
votes
4answers
137k views

Why do I need a tty to run sudo if I can sudo without a password?

I have configured sudo to run without a password, but when I try to ssh 'sudo Foo", I still get sudo: sorry, you must have a tty to run sudo. Why does this happen and how can I work around it?
0
votes
2answers
63 views

Why did sudo not work in CentOS? [duplicate]

I am using Centos and want to use sudo command to run as root. But after input the root password, it always prompt to ask me input the password again. I am pretty sure the password is correct since I ...
3
votes
4answers
6k views

Allow paswordless user to change to another passwordless user

I have two users dev and tomcat neither of them have a password. How can I allow dev 1 do su - tomcat without having him having to enter any credentials? 1 connects with ssh keyfile
0
votes
2answers
41 views

Can we install a package through a shell script? [duplicate]

I'm trying to write a shell script so that when I reinstall my Ubuntu again. I could just run script and retain all the packages. And I'm planning to pass password in form of argument. My question ...
0
votes
1answer
53 views

Running .sh Script With Sudo Results In Different Output

I'm seeing some really strange behavior in a script I'm working on.What I have is an svn hook that gets run whenever a commit is made to an svn repo. It runs a sqsh command that generates another ...
1
vote
2answers
57 views

Failed to open config file '/dev/fd/63', error: No such file or directory for wpa_supplicant

When I do this: sudo wpa_supplicant -D nl80211,wext -i wlp4s0 -c <(wpa_passphrase "some ssid" "password") I get Successfully initialized wpa_supplicant Failed to open config file '/dev/fd/63', ...
1
vote
0answers
28 views

Why does visudo compare the contents of `VISUAL` to a fixed whitelist? [duplicate]

This is on Ubuntu 15.10 I'm trying to get a better understanding of visudo and how it works. The documentation explains that visudo will consult the VISUAL environment variable and compare it against ...
1
vote
1answer
43 views

sudo: unable to resolve host “hostname”

I'm testing a VPS provider, and recently created a virtual machine with a hostname testserver using an ubuntu template. This VPS provider reserves and bills resources by the month, so if you create a ...