0
votes
1answer
25 views

Why does a double sudo modify permissions?

Context: sshed into an AWS t1.micro instance running Amazon Linux 2013.09, using the default ec2-user. I'm trying to list the contents of the default postgresql directory: What's in there? $ ls ...
21
votes
5answers
2k views

Sudo vs root; any actual differences?

I'm working with a support member for a product, and he insists that I need to be root to install a series of patches, and that sudo won't work; he doesn't provide a reason but seems very firm in his ...
0
votes
1answer
33 views

Permission denied on sudo remove

I have two users userA and userB. userA has permission over a file named cache. I want to give permission to userB to remove the file. I have made following entry in /etc/sudoers file : userB ...
1
vote
3answers
26 views

Add a sudoer non-interactively from command line

(On Centos through Docker) I know that I can add a sudoer using visudo. Is there a way to add a user to the sudoer list straight from the command line, so I don't have to do it interactively? I'm ...
0
votes
1answer
23 views

Run startup script with another user

I have two users user1 and user2. And tomcat has owenership of user1 and started with user1 only. I need to make a rule for user2 such that user2 can starts/stop tomcat but tomcat should always be ...
1
vote
1answer
30 views

Understanding implications of sudo -u -H

I'm trying to install gitlab from this guide on Ubuntu 14.04 Server. It is also worth mentioning that I'm behind a http proxy. I'm having problems with this line in particular: sudo -u git -H git ...
1
vote
2answers
23 views

Limit user to execute selective commands (Linux)

How can I limit my user to execute selective commands only. I have a user tomc in tomc group. I need this user to be sudo user and then to have restricted bash. I have tried following code in ...
0
votes
0answers
126 views

SU : Permission denied /bin/sh

I added a new user in system: $ useradd new_user When I try to switch from root to new_user, I get this error: $ su new_user permission denied /bin/sh $grep new_user /etc/passwd ...
2
votes
3answers
174 views

What exactly do the sudo -s command? and how is it used in this example?

I have the following doubt. In a tutorial related to a software installation that I am following say that I have to execute the following commands (I am doing it into an ssh shell, so this list of ...
0
votes
2answers
56 views

Setting node path and allowing to run as sudo

I've got a raspberry pi that I'm running node on. I followed this guide http://joshondesign.com/2013/10/23/noderpi to install node. When I setup the NODE_JS_HOME, I can run node from the command ...
1
vote
1answer
65 views

How to do admin tasks without becoming root on Debian?

How can one perform some administrative tasks from non-root account without becoming root on Debian 7? For example, my iptables block all network access for all users including root except one user - ...
0
votes
0answers
21 views

Sudo Cmnd_Alias Optional Arguments

I would like to allow a command to be run under sudo with or without arguements. For example, both of these should work: rm -f /etc/stuff rm /etc/stuff/item.txt To get this to work, I need this ...
1
vote
1answer
65 views

Adding sudoer for all but root

Here is the base of my problem: I would like to add sudo rights to a user, but not to use it as root for security reasons. I have a PHP script needing to run a command (drush) through exec(). ...
3
votes
1answer
147 views

'user is not in the sudoers file' but actually is

I have already read a lot of posts about enabling sudo-access for a specific user but those couldn't help me so far. The situation is: I'm running Debian Testing. On the system there are only two ...
2
votes
3answers
224 views

How do you set alias sudo='nocorrect sudo ' correctly?

Until Recently I had alias sudo='sudo ' in my .zshrc file. Today I ran into this error on trying to do sudo mv: ➜ ~ sudo mv nginx.conf.orig nginx.conf.orig2 sudo: nocorrect: command not found Now ...
-1
votes
1answer
39 views

Correct way to override file permission /dev/null

I am in a middle of this problem, and not sure which method to follow ? I am using a plugin which writes temporary files (*.txt / *.tmp etc.) to /dev/null. The plugin is complicated and changing the ...
0
votes
0answers
29 views

Inconsistent behavior from sudo ls -l and grep command running on AIX 6.1 TL9 SP1 after upgrade from AIX 6.1 TL8 SP3

Here is an example with grep [(qtjbc)l17asp03:/db2/DEV/scripts/updatekrnl]>sudo grep lt start_sap.ksh corp AD Password: if [[ $# -lt 2 ]] then while [[ ${IND} -lt ${NUMOFMOUNTS} ]] ...
1
vote
1answer
55 views

sudo command with equal sign (=) gets confused for environment variable

I'm trying to run various commands through sudo, where the equal sign (=) is a part of the command. Under certain cases, it seems that sudo confuses that sign for setting and environment variable. I ...
2
votes
0answers
42 views

Sudo works as su

Ive observed kind of strange behaviour. I have openSuse and when Im in console and want to gain root access for executing one command, after typing sudo it like switches me as if Id type su. ...
1
vote
3answers
357 views

How to execute commands as root in git post-receive hook

I just recently set up a remote git repo on a server for a web app running as an Upstart service. I'd like to use the post-receive hook to trigger actions that are required to update the application ...
8
votes
2answers
842 views

I need sudo without password prompt, for scripts. Where did I go wrong?

I am in sudo group all right: $ id uid=1002(molot) gid=1002(molot) groups=1002(molot),27(sudo),33(www-data) In my sudores I seem to have appropriate setting: sudo ALL=(ALL:ALL) NOPASSWD: ALL ...
3
votes
1answer
32 views

Ubuntu Linux sudo groupadd option menu keeps showing

I'm a beginner to Ubuntu and Linux. Every time I try to do a groupadd in my Ubuntu terminal the options for groupadd show up and I dont know why. I enter this in my home directory: sudo groupadd –g ...
0
votes
0answers
96 views

Seeing “sudo: effective uid is not 0” for users when an 'strace sshd' was running. Linux

Why would the following be a result of one user running strace sshd while another user attempts to use sudo? $ sudo ls sudo: effective uid is not 0, is sudo installed setuid root? The situation ...
0
votes
0answers
53 views

/etc/inittab combined with su - newuser failed to bringup new process with different UID than root

Using /etc/inittab on RHEL 6.3 x86_64 system, we tried to respawn a binary: aka watchdog from newuser UID login when restarted, not as a root UID process. Made the following changes as inline. ...
0
votes
1answer
146 views

Automated sudo and screen command

I would like to be able to launch a script in a separate screen command session as a separate user when I run a .sh script. Here is what I think it may be in the script: #I am also starting xampp ...
14
votes
4answers
2k views

How to prevent sudo users from running specific commands?

I have a very sensitive network setup and I really dont want to mess up with it. My network consists a bunch of users who are with sudo privilege. I want to stop them from running service ...
0
votes
0answers
54 views

How to connect Linux machines to a Windows Active Directory with different user rights?

I have a Windows Active Directory Setup with Windows Clients. So far our Linux machines did not authenticate against the AD, I used root to login. Now I wanted to add those Linux machines to the AD ...
0
votes
0answers
94 views

pip: which pip.conf will be used?

Commonly used to install python packages sudo pip install <package> To use a different repo, I edited ~/.pip/pip.conf [global] index-url = http://<hostname>/simple That works on my ...
0
votes
0answers
25 views

program needs to be run as root by any user and can be located anywhere

I have some program called foo that needs root privileges when it executes. foo needs to be able to be run by any user and can be located at any path. The reason this program can be at any path is ...
2
votes
3answers
1k views

How to login as root from Bash and do stuff

This is my simple bash: cat test.sh #!/bin/bash echo "hello" su - root -c /path/to/script.sh <<EOF password EOF whoami echo "good bye" But I get this error: ...
2
votes
1answer
119 views

difference between root executing command as sudo vs not using sudo?

I have a Linux question regarding the sudo command and the root user. If I log into the root user using the su command, what is the difference between the following two commands? root> sudo ...
1
vote
1answer
141 views

Sudo and file permissions

I am configuring sudo on a server and have the following question. I only want a user group to run the /sbin/ifconfig. I have configured sudo: User_Alias ​​NETWORK = user1 Cmnd_Alias ​​NETWORKING = ...
1
vote
2answers
66 views

To install and use Django 1.4.1 without sudo access

I want to install this software to a server where I have no sudo access. They have Django 1.2.x installed there, but the software needs Django 1.4.1. The server has the adapter between Python and ...
3
votes
3answers
2k views

command not found when using sudo

There are a few question on the site that seem related to my problem but I could not find a solution in any of them. My operating system is Ubuntu 12.04. I have mvn installed in ...
0
votes
1answer
246 views

I accidentally deleted the home directory on my Amazon Linux EC2. My whole site disappeared. What now?

I was using sudo rm -rf to delete some folders, and accidentally deleted the /Users/ec2-user home directory. I had my EC2 and AWS Route 53 running my site. Now, it just disappeared. I have all the ...
4
votes
1answer
55 views

Passwordless sudo works for one user, but not for another

I struggle to create passwordless sudo for one user on my Debian server. I've added the following line to the sudoers file: deployer ALL = NOPASSWD: ALL but it doesn't work. To my surprise, I can ...
1
vote
2answers
63 views

How do I configure a Debian so that multiple users can do administration, but not see each others' personal files?

I'm looking to set up a server to share with a group of people. The machine will run Debian GNU/Linux, and we would like to allow multiple people to do administration tasks (in particular installing, ...
0
votes
2answers
472 views

Ubuntu: Write to serial port: permission denied

I've connected a USB to Serial bridge dongle, and running dmesg | grep tty outputted the following: [ 0.000000] console [tty0] enabled [603199.380677] usb 2-2: cp210x converter now attached to ...
0
votes
0answers
34 views

sudo: Who am I really? [duplicate]

I am experiencing some weird inconsistencies using sudo. Users: carl, root Command: MakeHotdog root@laptop$ MakeHotdog Hotdog has been made! carl@laptop$ MakeHotdog Hotdog has been made! However, ...
0
votes
2answers
72 views

What's wrong with this configuration of sudoers file?

I have to execute a shell script as another user, but without being prompted for a password. I've edited the /etc/sudoers file with visudo, adding the following line. _www localhost=(otheruser) ...
1
vote
1answer
40 views

sudo is messing path order

I'm having a little issue with my PATH when I use sudo : My PATH from user shell : /usr/local/bin:/usr/bin:/bin:/opt/bin My PATH from root shell, via su or root login on TTY : ...
0
votes
2answers
122 views

Shebangs do not like sudo in OSX

Using sudo in the shebang seems completely broken. The following code: #!/usr/bin/sudo /bin/bash echo "this should work" works fine on Ubuntu, but on OSX gives me: sudo: effective uid is not 0, is ...
0
votes
0answers
50 views

“chown” for “make install” command?

On my Linux server, I accidentally executed sudo make install for an application install. I intended to execute make install without sudo privilege. How do I change the ownership of all installed ...
1
vote
1answer
246 views

SELinux transition from unconfined_r to user_r

On a Fedora 18 machine, I have the following SELinux context as a regular user created during installation: $ sestatus SELinux status: enabled Loaded policy name: targeted ...
1
vote
1answer
459 views

Disabling SU on all new users on Debian

I'm new to Debian, but learning things very fast. Working on Debian Wheezy, and I realize that if I create a new user with useradd, the user gets sudo rights! To test this, I log in with the new user ...
0
votes
1answer
489 views

su in shell script started from ssh works in other terminal

Sorry my dumb question but I don't know how to describe my situation. There are logs from Jenkins: ssh www.myserver.com '/var/lib/tomcat7/webapps/deploy_webapp.sh' + id uid=1004(jenkins) ...
3
votes
1answer
201 views

Can't Get libpam-ssh-agent-auth Working In Ubuntu 13.10

I've been wrestling with this particular issue most of the day, and have been making SOME progress, but I'm still a bit stuck. I would like to be able to authenticate an SSH session using a private ...
1
vote
1answer
365 views

Can't validate mine, sudo nor root in Debian “Jessie” Gnome anymore?

I'm Debian beginner & GUI guy in a bit of trouble? Can't login as sudo/gksu/root/su nor as (main/super)user after removed user password via Gnome-user-settings. History of actions (Probably ...
3
votes
1answer
151 views

How does sudo actually work?

How is it possible for sudo to actually function? If it's just a normal program, couldn't you make the same thing without requiring the user to authenticate, giving anyone with access to a computer ...
0
votes
2answers
113 views

Using the root account on a single-user system [closed]

On Linux systems it is widely considered a best practice using the root account only on occasions that necessitate administrative privileges, or disabling it altogether and relying solely on sudo to ...