sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

-1
votes
1answer
43 views

Make sudo ask for a password

After installing DevStack, I was forced to put my user as root and gain access. I did that and now I would like to undo it. I removed the line from visudo but still no success. What want like to ...
1
vote
1answer
24 views

Updating a bunch of Macs via SSH. Could use some help

all. I'm working on a script that'll be running from our Mac server, and it will (hopefully) update all of our Macs via Munki (repo is on the same server) and the built-in softwareupdate command. ...
2
votes
1answer
21 views

Problem with either su username -c “./script.sh” and sudo -u username bash -c “./script.sh” and Java classpath

I am seeing some strange behavior that has led me to wonder how the environment differs when running either of these 2 commands, versus using su username and then running the commands as the user one ...
1
vote
1answer
19 views

Root shell sees pip but sudo pip “command not found”

I have installed python 2.7.8 via make and make install and then pip via get-pip. I have to note that I work behind a proxy which I have set up via http_proxy ftp_proxy https_proxy in my user's ...
1
vote
2answers
49 views

Enable ssh root login

I have access to a CentOS server with a user that its not root but belongs to the sudoers list. I do not have the password of root, nor I can't find out what it is (policies of the people who gave me ...
0
votes
0answers
9 views

Running a script with elevated privileges [duplicate]

I need to find a way to run a script with elevated privileges but without compromising security. One suggested that i should use setuid but i don't think that is an option since it can cause serious ...
1
vote
2answers
47 views

Fedora: How can I add myself back to sudoers file?

I've accidentally removed myself from sudoers file by doing usermod -G user group without -a, and now I am not in the sudoers group. I've tried doing su - and entering root's password but it says su: ...
0
votes
1answer
40 views

Command not found when run with sudo bash

I ssh into my machine and then, in order to run some commands, I need to sudo bash first. In an interactive terminal session, if I do this: [vagrant@33 ~]$ sudo bash [root@33 vagrant]# which bundle ...
1
vote
1answer
30 views

Allow user to use sudo to execute anything, only one executable as nopassword [duplicate]

I have a Linux user that needs to be able to execute any command with sudo, but it should ask for their password for all apart from one executable. Currently my sudoers files looks like: # # This ...
0
votes
0answers
7 views

gksudo not honoring configuration in /etc/sudoers

Some time ago I posted a question which was related to whether it is possible to preserve environment variables when sudoing to a different user. As it turned out, this is indeed possible. When ...
0
votes
1answer
43 views

Details about sudo commands executed by all user

From which log can I get details about sudo commands executed by any user. It should contain the working directory, command, user. It will be helpful if you could provide me a shell script to do so
1
vote
0answers
30 views

sudo and sssd not working with user groups

Having a problem getting sudo that is integrated with sssd to work correctly when we use ldap to store the groups that have the different sudo privs. This works just fine if we have sudo set to go to ...
5
votes
2answers
47 views

Permissions depending on how you login: ssh/su/sudo

As user I have access to a remote linux machine where I can: sudo su - other_user Among other things, this allows me to add my own public key to authorized_keys for other_user, which effectively ...
1
vote
0answers
27 views

iptables usage from within a mod_wsgi application

In my mod_wsgi application I issue the following command to set up an iptables rule: sudo iptables -A PREROUTING -t nat -p tcp -d 10.80.0.163 --dport 502 -j DNAT --to-destination 10.80.0.163:1502 ...
0
votes
1answer
26 views

Security concerns

I've recently been struggling with ways to make a easy way for my father to both mount and unmount a harddrive on a linux based system. I thought of a way to execute a shell script with PHP. The ...
1
vote
1answer
43 views

Run specific command from .desktop with root

I have a program that I wish all users of my linux install to be able to run with root privileges from a .desktop file. Currently in my .desktop file I have: Exec=gksu command but this of cause ...
1
vote
1answer
37 views

How do I retain custom PS1 in super user mode?

The problem is this: I set a custom PS1 in my .bashrc, but it changes to the default one when I enter super-user mode. What I expected: ╓[coffee]─[Linux-Tower]─[2014-11-05, 23:41]─[~] ╙[$]-[sudo ...
6
votes
1answer
110 views

First sudo always slow

The first sudo I enter on my Ubuntu 14.04 server is always slow. The password prompt displays immediately, but after I press enter it takes about 10-15 seconds until the output is printed. All sudo ...
1
vote
0answers
12 views

How to resolve super user password problem [duplicate]

My super user password no longer works. My own fault I believe, messing around with usermod. Is there a way to resolve this? Using Ubuntu 14.04
1
vote
1answer
74 views

su cannot execute bin/bash/****

I installed Kali Linux on a VM machine and I cannot change my user to root from the terminal using su. The command sudo works fine but when I try to su, it says "cannot execute bin/bash/****(my user ...
0
votes
1answer
34 views

Open a new bash with sudo powers without reentering the password [duplicate]

I find very useful to have more terminal tabs in different current working directories. But if I need sudo privileges I need to reenter the password for every shell. Is there not a way to extend the ...
3
votes
1answer
46 views

Run command with sudo by default

Just one brick missing in my current wall. Feels to me like it should be easy to solve, nevertheless I got some explaining for you to do to make you understand what I want to achieve. I need a linux ...
0
votes
1answer
44 views

Why does “redirect to a file” is executed as user, even with sudo? [duplicate]

I often encouter this problem and it really bugs me on why it is so. So let's take this example into account : [me@localhost:~]$ sudo command > /some/file.log As far as I know, this will not ...
0
votes
1answer
32 views

Sudo requiring password

On a RHEL server I would like to let a user run a command as root without a password: # uname -a Linux foo.com 2.6.32-220.38.1.el6.x86_64 #1 SMP Wed May 15 08:34:56 EDT 2013 x86_64 x86_64 x86_64 ...
2
votes
2answers
42 views

does sudo always set process limits to the numbers from /etc/security/limits.d?

I have observed the following behavior: [ec2-user@ip-10-66-68-55 ~]$ uname -a Linux ip-10-66-68-55 3.4.103-76.114.amzn1.x86_64 #1 SMP Fri Sep 12 00:57:39 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux ...
1
vote
2answers
61 views

How to use sudo to delete the contents of a directory

I have a legitimate need to empty a directory to which my account does not have access (it is a cache directory used by an application, and is owned by the account that runs the application.) My ...
0
votes
1answer
45 views

Allow all users to call sudo -l

On my debian server, when a user who does not have any rights in the sudoers file or any include dirs, calls sudo -l, he gets the standard "responsibility header" and is prompted for his password. Is ...
1
vote
2answers
64 views

Add test user to the sudoers file, to run ifconfig

I would like to see the ifconfig file with test user (under Linux Debian) that's why I have used the sudo task, but the terminal said that: test is not in the sudoers file. How can I take the test ...
1
vote
1answer
48 views

What does this command “sudo pip3 install name-of-the-file.whl” do?

I'm quite a newbie using the Bash scripting language, but I'm trying to learn it a little bit more. I know that sudo is a command used for administrators' tasks, such that installing or uninstalling ...
1
vote
0answers
25 views

Is it safe to disable password for a user, if it only uses SSH key login?

We want to remove the password usage on a UNIX system. The users should only log in with SSH key. Not password. So their password field in the /etc/shadow file will be "*" and set their password to ...
5
votes
3answers
720 views

Why does “$ sudo echo 'yo' ” work even though echo is a shell built in function? [duplicate]

I understand that sudo cd /directory will return: sudo: cd: command not found because cd is a shell builtin and not a binary. But then, why does sudo echo 'this is a test' works fine? What ...
5
votes
2answers
735 views

Why doesn't 'sudo bash && cd desktop' cd in to the desktop folder? [duplicate]

I have a folder with chmod 000 permissions on it with a lot of different stuff in, the way I get in is a start bash in sudo by running sudo bash. Why can't I do &&? I want to cd into the ...
2
votes
1answer
218 views

Call sudo from Jenkins

I have one build machine which has a user abc which is has limited sudo access. When I check out the source code and run my build script, it works fine. The build script contains sudo calls for which ...
0
votes
1answer
53 views

The “Sudo” Command are for debian-based, Linux-based distributions, right?

Let's say that I want to teach someone the command line but in the beginning, I only want to teach them the sudo commands. This means all the basic and useful command lines but using sudo. This ...
2
votes
3answers
605 views

What mechanism prevents any user from accessing any other user's files via root?

On a multi-user system, what protects against any user accessing any other users files via root? As context, the question is based on my understanding as follows: There are two commands related to ...
2
votes
2answers
77 views

What is my sudo password?

When installing things I am sometimes asked for my sudo password. I don't remember ever having one or setting one. But I do know my su password which has always worked fine for me. It is not the same ...
0
votes
2answers
59 views

I get an error whenever I try to add myself to sudoers

So I installed Debian yesterday, and I tried to make myself a sudoer so that I don't have to be root every time I try to install something. However, this always happens when I add my user to the sudo ...
1
vote
0answers
54 views

gksu -S ask for password only once even when set to three times in sudo configuration

I have a problem with gksu command. It always ask for password only once even when I set Defaults passwd_tries=3 in /etc/sudoers file. Command: $ gksu -S --debug ls No ask_pass set, using default! ...
1
vote
2answers
134 views

Gnome 3 - custom keyboard shortcut to run command as root?

My keyboard backlight function keys don't seem to work, so I've written a script to change the keyboard brightness, which must be run as root. It is invoked like so... sudo /usr/bin/local/backlight ...
1
vote
2answers
60 views

How to check if the “sudo” permission will be necessary to run a command?

Is there a way to determine easily whether I can read or write to/from a given file, or whether I will need to use "sudo" to do so? Running commands unnecessarily as sudo means that those files get ...
3
votes
5answers
166 views

How to allow authentication with `sudo` using an alternate password?

I have been given a long password by my company for my Ubuntu system. This password is cumbersome to enter when authenticating with sudo repeatedly. Can I authenticate with sudo using a password ...
2
votes
1answer
98 views

Use sudo with ssh command and capturing stdout

I'm trying to run a command as root (via sudo) on a remote server, and capture stdout (but not stderr) into a file. eg. Something like this: ssh user@remote "cat /root/file.tar | gzip" > ...
2
votes
1answer
27 views

Why can I not do visual mode when using visudo?

I thought perhaps vim was in some compatibility mode of some sort. To make sure it was using vim instead of vi, I set the VISUAL environment variable but was still unable to get into visual mode ...
1
vote
1answer
59 views

Accidentally deleted /dev/tty, how to bring it back on debian7?

I am on debian 7 and accidentally delete /dev/tty so I cannot sudo su anymore. I can still ssh with my username however when I want to get root rights with sudo su I get following message: sudo: no ...
3
votes
1answer
112 views

scripting copy of remote root-owned files when 'PermitRootLogin no'

I'm setting up a cloud node (only ssh-accessible, GUIs deprecated, running Debian 7) with 'PermitRootLogin no' for security. For some applications I want to copy some root-owned config files from the ...
2
votes
1answer
70 views

ssh as super user

I did the following mistake on a remote server : # sudo chmod 700 / Now no user but root can do anything. I can't even ssh as a normal user anymore, since I don't have permission to access bash. ...
0
votes
0answers
26 views

cant edit anything on xampp as sudo user [closed]

I’m new to Linux was an avid Windows user until recently trying on an old system seeing some major differences and converting, so I apologise if this question seems simple. I’m running the latest ...
0
votes
1answer
68 views

Is it possible to set the users .gitconfig (for git config --global) dynamically?

I have the problem, that we login to the systems as our own users johndoe and then have to do a sudo su - root to be able to do administrative tasks. We have the system config files in a git ...
1
vote
2answers
114 views

Pass arguments to a command run by another user

I have a bash script that is supposed to take some arguments and then run in a different user: test.sh #!/bin/bash sudo su user2 <<'EOF' echo $1 EOF However it prints blank: $ ./test.sh ...
0
votes
2answers
86 views

How can I sudo su and change directory just after?

I would like to create an alias that does something like this: alias userYYY='sudo su userYYY; cd /a/path/that/only/userYYY/has/access' So then from my command line, I am logged in with a sudoer ...