sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
2answers
88 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 ...
0
votes
2answers
46 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
55 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
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
59 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 ...
1
vote
2answers
92 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', ...
0
votes
1answer
99 views

what is meant by Defaults:visiblepw in /etc/sudoers file

Im newbie to linux, when i was reading sudo config file, there is a line Defaults visiblepw . i read the definition for the visiblepw in manual page visiblepw By default, sudo will refuse to ...
0
votes
0answers
24 views

kerberos: Why sudo command creates a ticket?

I have successfully set up a kerberos (MIT) / OpenLDAP debian server which can authenticate users with kerberos and get SSH access according to OpenLDAP groups. I must mention that as this is a ...
5
votes
4answers
695 views

Allow user to run a command with arguments (which contains spaces)

I want to allow one user to run grep (through sudo), and to grep for one specific string in one specific file. I don't want to allow this user to be able to run grep on all files. The user doesn't ...
3
votes
1answer
33 views

How to temporarily change locale for sudo?

To change the locale of the current user like export LANG=en_US.UTF-8. But this environment variable doesn't affect the root user. When I use sudo the display language remains default. How can I ...
3
votes
2answers
41 views

Feedback when entering passwords, without revealing length

I often SSH into a machine and use sudo on it. When entering passwords, I'm always afraid that another window will steal the focus. However, I don't want to display asterisks (with pwfeedback, for ...
0
votes
3answers
87 views

I want to copy a remote txt file via SSH, but without using root access

I want to copy my hosts to remote /etc/hosts but it doesn't work. I know root SSH access makes things easier, but IMHO root SSH access is a little dangerous. cat /etc/hosts|ssh samba2 "sudo su -c "...
0
votes
5answers
93 views

copy file from user to another in linux

I'm trying to copy a file from my home directory to another user's directory. I have a sudo access for the other user with no password. I tried doing something like: sudo secondUser cp /home/...
0
votes
1answer
36 views

How can I avoid being prompted for a password in this script? [duplicate]

I’m using Amazon Linux. If I login as my “otheruser” user, and create a script, test.sh, with this text sleep 5 ; sudo reboot now I can login and run the script like so … [davea@mydevbox ~]$ sudo ...
1
vote
2answers
63 views

What does “sudo su -s /bin/bash - <username>” do?

Could someone kind enough explain to me what this command means? sudo su -s /bin/bash - foo I was told that if I want to switch to a different account in this case "foo" without knowing its ...
2
votes
1answer
31 views

Exporting a variable so it appears in a script sourced through sudo

I have a bash script/s which has a "main" script which is run as sudo. Variables are declared in this script. Then it sources another commands.sh script, however this script uses sudo to drop back to ...
1
vote
1answer
31 views

Pass Environment Variable to Sudo AWS ec2 sudo node

I am new to linux and AWS. I have a node.js server running on an EC2 instance. I am running the following command to keep it running endlessly and on port 80: $ sudo node app.js & Now when I ...
1
vote
0answers
24 views

How does shutting down require sudo except when done through a GUI? [duplicate]

If I want to shut down my machine programmatically or on the terminal, I must do sudo poweroff or sudo shutdown. If I want to shut down my machine through my window manager and desktop environment, I ...
5
votes
6answers
732 views

What is the threat of a user trying to sudo without permission?

I was sshing into a certain computing system that I use. I was trying to follow some Linux instructions that involved sudo, and tried a few times to enter the password unsuccessfully, before realizing ...
1
vote
2answers
56 views

Why when I try to execute a program as normal user I get denied, and when I execute it with sudo I get “Not Found”

In order to execute mysqlbackup I have to execute it as root. Here's the example when I execute it as normal user: mysqlbackup --compress --user=root --socket=/var/lib/mysql/mysql.sock --backup-dir=...
0
votes
1answer
71 views

How can I execute any command as a normal user without sudo?

Is it possible to assign the sticky bit to sudo in order to execute any command as a normal user? Let's suppose that we have the user test and then: test@test$ apt-get update But I don't wanna use ...
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
0answers
49 views

Authentication required to edit Sudoers - User not listed

I made a small typo in my sudoers file, nothing a simple pkexec can't fix. The problem is that when I added my user with "adduser name" and added "name" to visudo, as well as the root and sudo groups:...
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 ...
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
1answer
75 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
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 ...
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. ...
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 ...
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 ...
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 ...
2
votes
1answer
56 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
53 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
69 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
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
1answer
77 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
118 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 ...
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
51 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
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 `...
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 ...