sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
1answer
89 views

I can't use the “sudo” command on my server [duplicate]

After I edited the /etc/sudoers.d/my_sudoers file with nano I was unable to use sudo. The following errors are giving when trying to use sudo: sudo: parse error in /etc/sudoers.d/my_sudoers near ...
10
votes
1answer
115 views

Possible to check ability to sudo before sudo'ing?

I'm writing a small utility program. I'd like it to attempt to sudo-run something if required. That is: if file permissions don't allow the current user to operate on a particular file (and sudo ...
1
vote
1answer
45 views

SOLVED Missing partition / drive Centos 7

I was trying to change permissions on one of my NTFS partitions and I think I have messed something up. I entered the below command on Centos 7 and now the partition is missing from the File Manager. ...
3
votes
4answers
162 views

How to execute multiple commands remotely on few servers?

I am trying to automate these steps so that I don't need to do this on every machines manually. I need to install latest app server software (abc.tar.gz) on all the unix boxes. I need to do this in ...
1
vote
1answer
104 views

Mass deployment of package to multiple Linux servers across different continents

I'm new to here and want to raise an interesting question about mass remote configuration of Linux servers. Imagine you get a list of IP addresses for 100 servers with a fresh install of Ubuntu, ...
1
vote
1answer
31 views

Mechanism behind password storage in sudo

Whats the mechanism behind sudo that stores the password for all subsequent calls to sudo?
0
votes
2answers
92 views

Sudo with password and append to file via SSH

What i'm trying to do is the following. SSH to remote host. Append the public_keys in the logged in users authorized_keys file to all the users .ssh/authorized_keys file. I've run into problem ...
2
votes
0answers
52 views

How would I limit users' sudo permissions for journalctl to a specific unit?

I want to provide our users access to journalctl of a specific unit. For e.g., httpd. My initial thought was to specify the command spec like this: /usr/bin/journalctl -u httpd.service * This will ...
2
votes
1answer
65 views

How to restrict su from root to nis clients

We are using NIS services for users login for Unix accounts. We have test machines where users themselves install OS and they get root access. Users are using su from root account to NIS user accounts ...
0
votes
1answer
86 views

Execute commands without sudo inside jenkins

I've imported a bunch of jenkins jobs and these jobs have a lot of shell script commands.There are no sudo before these commands.Jenkins has its own user.Is there a way so I can execute these commands ...
0
votes
2answers
79 views

mussh no tty present and no askpass program specified

Using MUSSH on remote machine to execute a bash script $ mussh -a -i ~/.ssh/id_rsa -d -H mas-hostfile -c 'bash script.sh' -m2 sudo: unable to resolve host hostname aurelien@000.000.000: sudo: no tty ...
1
vote
3answers
210 views

How come root can do this, but sudo can't? [duplicate]

I am set up as a sudoer on my Debian machine, and I use it all the time to install software etc... I came across this interesting situation that I am scratching my head about: I tried to enable the ...
1
vote
2answers
64 views

How can I create a sub-directory where my group has no write permissions?

I am working in my Tomcat deployment directory. The files in the directory have the permission: drwxrwsr-x. 10 tomcat www 4.0K Mar 15 15:14 webapps A sample sub-directory within webapps looks ...
0
votes
1answer
84 views

Use “module load” as root on Ubuntu 14.04

I have a series of tools that I load into my workspace using "module load 'tool ". However, if I try and run this command as root (or just using sudo), I get "module:command not found". None of the ...
1
vote
1answer
50 views

User still has sudo privileges despite being removed from all groups

I have a user, say userX on a Centos7 machine. I have removed all the groups from this user and this user is now assigned only to the group userX. However, I am still able to use sudo su and become ...
3
votes
1answer
81 views

how to: Please sudo, do _not_ setup any environment, especially $SUDO_USER?

I want to start a process as another uid and it should not need any information from $(env), so I strip the environment prior to the sudo -u powerlessuser /bin/processCmd, that is I run this env -i ...
3
votes
3answers
177 views

Executing a Bash Script Function with Sudo

I have a script that does a number of different things, most of which do not require any special privileges. However, one specific section, which I have contained within a function, needs root ...
1
vote
2answers
106 views

How to protect/secure the “sudo” log_input/log_output logs? [duplicate]

My Chief Security Officer (CSO) want to log the activity of the privileged account (root). I know I can configure sudo to log user input (key strokes) and console/terminal output (stdout/stderr), as ...
0
votes
1answer
83 views

User with UID 0 problem

I am running into an issue with Redhat 6.7. We installed a piece of software that created a user admin with uid of 0. This is a turnkey install of the software so I am really unable to change the uid. ...
0
votes
0answers
153 views

Unable to su to any user as root on Red Hat 6.7 server

System: Red Hat Enterprise Linux Server release 6.7 (Santiago) I am trying to su to kms user(OS user) as root but i keep getting error saying You are required to change your LDAP password ...
3
votes
2answers
103 views

`sudo -u user` in shebang line

I'd like to be able to run a script as another user, and only as that user. The way I currently have this set up is to have alice ALL = (bob) NOPASSWD: /home/alice/script.sh in the sudoers file ...
0
votes
2answers
58 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
29 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
60 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
125 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
30 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
77 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
53 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
37 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
111 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
96 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
85 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
70 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
74 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
71 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
46 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
48 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
63 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
67 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
150 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
49 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 this)...
0
votes
0answers
98 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
22 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
114 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
313 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
25 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
68 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
84 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
29 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
123 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: /sbin/...