sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
2answers
45 views

Granting a 'normal' user ability to mount a drive (visudo)

I am running a server on AWS that requires a storage volume to be mounted on an as-needed basis. I need 'normal' users (those without any sudo privileges etc.) to be able to mount this drive and ...
0
votes
1answer
27 views

Why does Logic Application not work except directly under sudo?

I am trying to run Logic application to talk to my logic analyzer, and I observe the following behavior, after I install the rules under the driver. ./Logic ./Logic: cpp_libs/libc.so.6: version ...
1
vote
0answers
54 views

BASH dd problem

i am trying to learn bash and now im trying to do a script for burning isos. I made the number "4" command to make sure the variables were right. the message i get when i complete my program and ...
4
votes
1answer
114 views

Launch a sudoed command upon script termination?

I'm coding a bash script that: runs some sudoed command at initialization releases root permissions for security purposes (sudo -K) runs an unprivilegied program but needs root permissions when ...
1
vote
2answers
29 views

Is there a log for errors for process that reads the sudoers file?

On Ubuntu 14.04 or CentOS: If I'm editing the sudoers file and I make a mistake or something, is there a log file that I can check to see if there are any errors?
5
votes
2answers
63 views

Why is it safer to give sudo rights to a non root user?

I have recently installed Amazon Linux on EC2 to run NodeJS applications. It is recommended to run them as a non root user. This user will still be me so there is no concern that someone else will ...
1
vote
1answer
42 views

Variable expansion in sudoers file

Under /some/long/and/annoying/path I have several scripts I need to give sudo access to, so I write in my /etc/sudoers (A): Cmnd_Alias MY_SCRIPTS = /some/long/and/annoying/path/foo.sh, \ ...
0
votes
0answers
29 views

Workaround for running privileged commands from www-data user

I would like to append a string to a file located in /tmp/ from a php script. The command I would like to execute is: sudo sed -e 's/$/,yes/' -i /tmp/a.csv The Problem I can't run a sudo command ...
1
vote
0answers
74 views

How can I switch from one user to another user inside a script?

.The issue is my id 'aaa' can read only the file name and not the contents inside it when I log in with my id "aaa". So to read the contents I have to switch to another user "bbb" which is having ...
1
vote
1answer
47 views

Set sudo umask apart from the user calling it

The problem: I set my umask for my user to be 0077. Now I use sudo instead of su when I need super-user access, and the problem is that whenever I execute a software installation using sudo with ...
0
votes
2answers
71 views

First line missing in concatenation of SSH output [closed]

I am trying to concatenate two strings in bash script but I am not able to get the expected result, USERNAME="ubuntu" MASTER="some IP" KEYFILE="/Path/to/keyfile.pem" STR1=`sudo ssh -q -t -o ...
1
vote
0answers
35 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 ...
0
votes
1answer
47 views

Sudo cron job using arp-scan gives empty output

I made a script called hello.sh and it contains the following: #!/bin/bash printf "$( arp-scan --interface=eth0 --localnet )\n" printf "test\n" after making it executable (chmod o+x) and running ...
1
vote
0answers
39 views

Why does LXC-create returns error “sudo.conf should be 0”?

I try to create an unprivileged container and nothing works as expected. Here is my code : follows that tutorial #!/bin/bash sudo apt-get update sudo apt-get dist-upgrade sudo apt-get -y install ...
1
vote
2answers
35 views

How can I execute a script as root, execute some commands in it as a specific user and just one command as root

I would like to execute a script as a normal user and execute a command that shuts off apache (which needs a root password). I was wondering if is possible to run the script with sudo but it ...
0
votes
0answers
42 views

Is there a (256) character limit on linux/ubuntu user passwords when using sudo?

[I'm no expert in Linux.] When creating a user that I would rarely use the password on, I used an extremely long password (500 characters). Everything seemed fine, until I used sudo for the user and ...
0
votes
3answers
51 views

Execute command after GUI-application has started

I have to use a home-built tool at my company which requires 'root' privileges. To make things worse, it's a GUI application. Normally, I wouldn't execute such things, but I don't have much of a ...
0
votes
2answers
58 views

bash file permission error while appending to a file [duplicate]

I am installing Voipmonitor whose setup script has this step: sudo echo " * * * * * root php /var/www/html/php/run.php cron" >> /etc/crontab I am getting this error -bash: /etc/crontab: ...
1
vote
1answer
89 views

debian 8.2 can no longer su to root

If I try to "su root" with an incorrect password, I get the expected 'authentication failure'. If I try to with the correct password, I get 'setgid: Operation not permitted" I have tried the usual ...
1
vote
0answers
31 views

Run mkvirtualenv command as another user

I want to run the "mkvirtual sth" but I have to run the script as superuser. sudo ./install.sh install.sh looks like this: # ... mkvirtualenv sth # su - geeret -c "mkvirtualenv sth" # (tried ...
0
votes
0answers
60 views

Unable to use Nautilus

I've got Trisquel 7 GNU/Linux distro, with GNOME 3.8.4. I'm finding impossible to create a folder in Nautilus, or drag and drop files into the Desktop, out of other options. I find this quite ...
0
votes
1answer
9 views

Setting www-data (lighttpd) as sudoer not working

I have installed lighttpd with fast-cgi on the raspberry pi. When running a python script that requires root priveleges, I get the following error: RuntimeError: No access to /dev/mem. Try running ...
1
vote
1answer
79 views

How do I maintain sudo in a bash script?

If I run this script, how do I pass super user permissions to it? I wrote this just to setup new machines with the basics. I don't want to run every command with elevated permissions, but the commands ...
3
votes
1answer
202 views

How to use sudo -u option?

I have 2 users, userA and userB. userB needs to run some commands as userA. I have specified these options in /etc/sudoers as below: userA ALL=(ALL) ALL userB ALL=(vinoth) /sbin/fdisk I ran this ...
1
vote
1answer
20 views

Getting syntax error in sudoers file I don't understand

I have an embedded system with the root mounted as read only. I want to set up so my sudo users are able without a password change the setting (I plan to use the commands in the login and logout ...
1
vote
1answer
54 views

Running a Bash expression from sudo

I can list my recent apt-get history with:- zcat /var/log/apt/history.log.1.gz I am trying to automate this for all history files. I tried: sudo for logf in $( /var/log/apt/history.log.?.gz ); do ...
2
votes
1answer
79 views

Strange bash script behaviour

I have two bash scripts, which are binary identical, have the same permissions, are unique on my drive and are not found in sudoers. Still one passes the uid test for root, the other one not. If I ...
1
vote
0answers
26 views

User can sudo although he is not in sudo group nor in /etc/sudoers

I have two colleagues on a Red Hat Enterprise Linux Server (release 6.4). Both of them can execute the sudo commands. Curiously, only one of the colleagues is in the /etc/sudoers file - let's call him ...
1
vote
2answers
91 views

Why do I still need to run shutdown as sudo after this?

I'm running Linux Mint 17.3. By default, running shutdown or other commands like reboot, poweroff requires root privilege. So I added the following line lesaff_b ALL=(ALL) NOPASSWD: ...
-1
votes
1answer
59 views

Report of sudo usage

How do I get a report (either CSV or an Excel file) on who is using sudo on my machine, and which account they're switching to?
0
votes
1answer
37 views

Why doesn't 'sudo' skip hostname-checking when the command can be run on 'ALL' hosts?

The sudoers file provides a way to limit which "runas" entries apply to which hosts. When running a command with sudo, the hostname is checked against the hosts on which a "runas" entry applies. When ...
2
votes
2answers
73 views

OpenSUSE disabled root login (no root psswd set) >> yast, config issues

I disabled the root login on my system (blank password). Now I cannot configure my system from GUI (it asks for the root password). Everything is fine in CLI (e.g. launch yast2 from CLI works ...
0
votes
1answer
68 views

Add AD users to sudo group not working | CentOS 6.7

Just as the title states I am on CentOS 6.7 and want to add two domain admins to the sudo group. I have tried adding both users individully and both together see below: someuser ALL=(ALL) ALL ...
1
vote
1answer
52 views

PermitRootLogin No and Sudo user – Where is the difference?

So, I've read that I shouldn't permit root logins by disabling them in my sshd_config. I understand how that might make a server safer, but if I have a user that is allowed to do "su root" and log ...
-3
votes
2answers
65 views

How are setuid, suid, sudo, and su all related? [duplicate]

I have a feeling the setuid bit, the nosuid mount option, sudo, and su are all related given their names. But how do they relate to one another? Are some of them used in conjunction? If they are not, ...
0
votes
1answer
141 views

How to fix a corrupt .profile file for sudo user

My knowledge on unix is very less. I updated .profile file for sudo user but some path was incorrect in that file. When I am trying to reconnect as a sudo user it does not recognize any commands and ...
0
votes
1answer
36 views

How can I undo a 'sudo' command before entering the password?

I typed sudo [bad command]. The system is asking for my password. I do not want to run this command. How can I exit the password-request prompt?
2
votes
2answers
28 views

Lock A Built-in Application?

I know I am able to lock an application using: sudo chmod a-x /Applications/'Application'.app but I encountered a problem while trying to lock an application, like safari, which is built in. ...
-1
votes
1answer
26 views

Ask password in window mode after sudo or other command line operations?

Was seen in movies, that after command line operations, the password was asked in separate GUI window. From my (small) experience, password, required from command line, was always asked in command ...
3
votes
0answers
32 views

exists a “two-factor authentication” for sudo, if not how to make one anyway?

tl;dr normaly to gain root priviledges via sudo requires a special user account and the use of its passphrase as means to authetication. Due to keylogging/replay (in X.org session) attacks, I would ...
1
vote
1answer
107 views

Centos 6.7 broken Sudo

After installing devtoolset 2, it appears my sudo command is broken. readlink -f $(type -P sudo) /opt/rh/devtoolset-2/root/usr/bin/sudo I believe the commands I ran to install devtoolset2 ...
1
vote
1answer
153 views

Why does running sudo cp show two processes

I am trying to copy some files and folders on a Centos machine. I do it like so: sudo cp source destination & to run it in the background. I see there are three cp processes now when I run ps ...
0
votes
1answer
28 views

Is sudo useful to protect my data from malwares?

I'm considering creating a separate account for browsing, and launching my browser with sudo -u browseraccount {firefox,chromium,etc}. I wonder if this can prevent a malware (especially ransomwares) ...
0
votes
1answer
181 views

How do I ask password by GUI prompt while using sudo in script?

I use Trisquel GNU/Linux with GNOME Flashback Desktop Environment. I need a GUI password prompt for user for executing command with sudo in script. Example consider following script: zenity ...
54
votes
6answers
5k views

Why does reboot and poweroff require root privileges? [duplicate]

To restart or shut off Linux from the terminal, one can use reboot and poweroff, respectively. However, both of these commands require root privileges. Why is this so? What security risk is posed by ...
1
vote
1answer
30 views

Visudo sanity check for the whole ecosystem of included files?

Is it possible to perform a visudo sanity check for a file in the context of other files included from /etc/sudoers.d? Scenario: I want to add a new file to /etc/sudoers.d the file itself is correct ...
0
votes
0answers
38 views

How to configure Double Commander to ask for my password and use sudo when it needs it?

As a Total Commander lover I am trying to replace it with Double Commander as Midnight Commander doesn't feel enough to me (needless to say standard single-pane file managers don't). One of the ...
2
votes
1answer
97 views

How is sudo interrupted in xterm on Ctrl-C? [duplicate]

Please explain in detail (including tty related stuff) how is a sudo foreground process on a X terminal emulator actually killed on the Ctrl-C. See the following example please: $ sudo -u test_no_pw ...
1
vote
2answers
85 views

Invoking a script with sudo ignores the shebang

Invoking a script using sudo ignores the shebang and runs the script in a different shell. To test, I created a script (test.sh) containing: #/bin/bash echo "BASH is: $BASH" echo "actual shell is: ...
1
vote
2answers
56 views

Add user with root/administrative privileges

quick questions. I'm running lots of Debian boxes (as servers), we don’t install the UI. We would like to setup monitoring Via a SSH connection (monitoring tool establishing an SSH connection to scan ...