sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
2answers
78 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 ...
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
52 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?
0
votes
0answers
23 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 ...
0
votes
1answer
27 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
145 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
42 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 ...
1
vote
1answer
61 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 ...
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
14 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
32 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 ...
0
votes
2answers
96 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
47 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
56 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
62 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
103 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
108 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
27 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
708 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
88 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
101 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
70 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
32 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
32 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
58 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
79 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
50 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
44 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
80 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
113 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
137 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
80 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
80 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
47 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
58 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
58 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
71 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
59 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 ...