sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

1
vote
1answer
46 views

how to do administrative commands without sudo?

Is there a possibility to grant administrative privileges to the current logged in user forever? So I don't have to type sudo everytime I want to do something?
0
votes
2answers
40 views

run a sudo command, specifying the password on the same line

I would like to do something like that: sudo -p password rm /a/file Can I put the password and the user on the same line? My Sudo version is 1.8.9p5
0
votes
0answers
24 views

sudo not working on two systems, but runs on remainder of the networked systems

This question is about sudo implementation and I was unable to find a similar question here in the forums. I'm running Redhat 6.6 on my network of 14 servers and 8 workstations. On the primary NIS ...
5
votes
2answers
288 views

How to automaticaly enter sudo's grace period upon login

Knowing that giving a user a sudo's grace period right from the point when he/she login might be a security issue, I still think it will be a beneficial trade-off between security and usability in my ...
0
votes
1answer
76 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 ...
1
vote
1answer
41 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. ...
10
votes
1answer
111 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 ...
15
votes
4answers
12k views

sudo cannot open /etc/sudoers

sudo does not work. I have Arch Linux installed on a USB key formatted with BTRFS. Here's the output when I run 'sudo': $ sudo sudo: unable to stat /etc/sudoers: Permission denied sudo: no valid ...
2
votes
3answers
2k views

Why does sudo su work, but su does not? [duplicate]

I have tried this on Fedora and on Ubuntu. kshitiz@kshitiz:~$su su: Authentication failure kshitiz@kshitiz:~$sudo su root@kshitiz:/home/kshitiz# I am entering the same password in both the cases.
34
votes
5answers
10k views

How can I `alias sudo !!`?

I'm trying to set an alias for sudo !! in Bash. I tried alias sbb='sudo !!', but it interprets that as a literal !! and prints sudo: !!: command not found If I use double quotes, it substitutes ...
3
votes
4answers
130 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 ...
6
votes
3answers
6k views

Write to a file without redirection?

I am writing a regular compiled application that needs to create a special file and write a magic cookie into it. I can’t write the file directly from the application, the system security model ...
2
votes
4answers
4k views

How to restore to permissions to sudoers file with no password?

The complete story: I launched an Amazon EC2 "Tier" (VPS) running RHEL 7.1 and created a key for ssh. EC2 automaticly crates a user called ec2-user for new Rhel VPSs, and it have the permissions (in ...
1
vote
1answer
76 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
30 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
77 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 ...
11
votes
6answers
3k views

Set sudo password differently from login one

As a privileged user I am trying to set the sudo password to another then the one used at login. I have done some research but have not found an answer. Does sudo support that kind of configuration? ...
19
votes
4answers
22k views

How to set visudo to use a different editor than the default on Fedora?

Fedora 14 uses vi by default when one runs visudo. Is there a way to change this to something else?
2
votes
0answers
45 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 ...
3
votes
2answers
1k views

How to stop sudo PAM messages in auth.log for a specific user?

I am using Zabbix for monitoring my environment and zabbix_agentd executes as user zabbix one custom script every 60 seconds; it uses sudo to run this script as root. In /var/log/auth.log I see every ...
1
vote
3answers
206 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
57 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
54 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
3answers
119 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
87 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
63 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
110 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 ...
0
votes
1answer
28 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 `...
3
votes
2answers
99 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
52 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 ...
1
vote
0answers
58 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
123 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 ...
4
votes
1answer
289 views

/proc/net/wireless does not show values unless run as root

cat /proc/net/wireless does not show statistics for wireless devices unless it is run as root, even though the permissions on the file are 444. The same seems to apply when accessing statistics via ...
1
vote
1answer
52 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, \ ...
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?
4
votes
2answers
5k views

Can edit file as root, but not using sudo

I just faced a really strange situation. I was trying to edit file /usr/lib/thunderbird/thunderbird.sh, which has the following permissions: $ ll /usr/lib/thunderbird/thunderbird.sh -rwxr-xr-x 1 ...
2
votes
2answers
268 views

How to gain sudo access after powerwashing (factory resetting) my computer?

I just powerwashed (that's a factory reset on chromebooks) my computer so that it would be be 'brand new,' however now I don't have sudo access anymore. I used to not need a password to use sudo, ...
0
votes
0answers
34 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
93 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 ...
0
votes
2answers
77 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
59 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 ...
0
votes
1answer
62 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
2answers
41 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
47 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
58 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
63 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
127 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 '...
32
votes
3answers
24k views

How to make `sudo` preserve $PATH?

I need to run a program installed on /opt/godi/sbin (a custom directory). If I add that directory to my PATH, by adding the following line to my .bashrc file export PATH=$PATH:/opt/godi/bin:/opt/godi/...
1
vote
0answers
42 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)...