sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

2
votes
1answer
172 views

Sudo email notification setup error

I'm Using Centos version: [sysadmin@backup-srv ~]$ cat /etc/redhat-release CentOS release 6.4 (Final) I'm using this sudo version: [sysadmin@backup-srv ~]$ sudo -V Sudo version 1.8.6p3 Sudoers ...
2
votes
2answers
130 views

Will I be prompted for the sudo password a second time?

This is what I plan to do: #!/bin/bash sudo -i <<'EOF' iptables-save | awk '/^[*]/ { print $1 } /^:[A-Z]+ [^-]/ { print $1 " ACCEPT" ; } /COMMIT/ { print $0; ...
2
votes
1answer
182 views

How to create an executable bash script for these commands?

I wish to create an executable bash script that will run the following commands as root, that is, using sudo su iptables-save | awk '/^[*]/ { print $1 } /^:[A-Z]+ [^-]/ { print ...
0
votes
3answers
527 views

SSH Agent-Forwarding works, but what about sudo -u username no shell/ permissions? composer

Working on a remote server (A) I want to use my local SSH-Keys to access a repository on another server (B) that is not controlled by me. Generally this works like a charm. I log in as myUsername ...
0
votes
0answers
104 views

Debian wheezy using gnome classic requires root for system modifying changes

I am using Gnome classic on Debian Wheezy, and I sometimes get a popup for package updates. The UI prompts for a root password, and will only accept root. Is there some way for me to add my account to ...
1
vote
2answers
85 views

Why does it take more time for a login to fail than to succeed? [duplicate]

When logging in to my PC, and the password is correct, the login takes place nearly instantaneously. When the password is wrong, it takes a few seconds of waiting until the hint "The password is not ...
1
vote
3answers
872 views

Wrong Permission to /etc folder [duplicate]

I have given the wrong permission to the /etc folder chmod -R 777 /etc When I want to login as root it gives me an error and the following output. How can I correct the permissions? ...
0
votes
1answer
43 views

Write a file in /var/lib/sysnews/ [duplicate]

In that folder are stored the news files: they can be created by the system administrator to write some informations for the users, as suggested in this link. I tried as a normal user to add a file ...
5
votes
1answer
86 views

Why does visudo discourage other editors?

man visudo explains that visudo will not (by default) use EDITOR or VISUAL environment variables. It states that "There is no easy way to prevent a user from gaining a root shell if the editor ...
4
votes
1answer
1k views

Sudo permissions by ldap groups via nslcd

I have a problem with my sudo permissions in an MS ActiveDirectory to Debian LDAP authentication/authorization setup. What I have so far I've configured nslcd with libpam-ldap via ldaps and ssh login ...
0
votes
1answer
840 views

Adding www-data to /etc/sudoers dos not work for PHP shell_exec() to run a command

I'm running the webserver lighttpd on Raspbian (Debian based) on a Raspberry Pi. The server runs as user www-data (checked with ps aux). I added the following line to /etc/sudoers: www-data ...
2
votes
1answer
104 views

Root Password Policy and Refresh

Unfortunately the infrastructure I work in has static root passwords that are very rarely refreshed. So people leaving the company will have our root passwords and it can potentially be leaked to ...
-1
votes
1answer
167 views

Why sudo ./bin/mysqld_safe & on Mac OS X 10.6.8 doesn't ask for password?

I get the following permissions from terminal: $ cd /usr/local/mysql $ ls -l drwxr-xr-x 41 root wheel 1394 29 Apr 00:55 bin drwxr-xr-x 4 root wheel 136 29 Apr 00:55 docs ...
3
votes
2answers
2k views

I'm not getting privileges, edited /etc/sudoers [duplicate]

I want to run any program without asking root password. Because I'm the only person who use the system. So I googled and edited /etc/sudoers. What I did: # chmod 640 /etc/sudoers # vim /etc/sudoers ...
4
votes
2answers
996 views

System Crontab or Root Crontab

System crontab: /etc/crontab Root crontab: sudo crontab -u root -e Which way is preferred? As they all run tasks within administration privilege.
0
votes
1answer
99 views

Can't simulate initial login using sudo

$ sudo -iu cyrus sudo: unable to change directory to /srv/cyrus: Permission denied sudo: unable to execute /bin/zsh: Permission denied I don't understand why I would get permission denied for ...
3
votes
2answers
108 views

User created without a password behaves as if he had one

Inside one of my scripts, I created an user based on a directory arrangement on another machine. The thing is that this user, created without a password, behaves just as he had one : he has sudo ...
1
vote
1answer
2k views

How to execute changes on remote server as root?

I'm wondering if there is a way to execute a script/commands from the the local machine without making any modifications as root on the remote machine? Some background I'm trying to setup some tasks ...
2
votes
2answers
268 views

How does sudo really work? [duplicate]

This question might be stupid, but I am unable to answer it myself. I always thought that "sudo" just starts another login-process, specifically using "root" as a username and asking for the Password ...
2
votes
0answers
143 views

Why sudo won't remember my password?

I use sudo in many systems, but I have one of them that makes me type my password each time I run sudo. All the others remember it for a while. This is debian 7.4 wheezy and sudo 1.8.5 I found this : ...
0
votes
1answer
180 views

Directory locked! [closed]

I have been trying to install virtualbox using this command: sudo apt-get install virtualbox.qt But I am getting this error: E: Unable to lock directory /var/cache/apt/archives/ I have been ...
1
vote
0answers
43 views

Passwordless sudo not working [duplicate]

I am trying to setup my server so that I can restart Apache as userx without having to enter a sudo password. However when I logon as userx and run sudo /usr/sbin/service apache2 restart it asks me ...
6
votes
1answer
112 views

Send only one warning when the private key is not available

For added security, I would like to require a private key to use sudo on my Ubuntu Server box. I've added private key authentication for sudo as described at ...
4
votes
1answer
115 views

How can I add sudo permission for copying? [duplicate]

my sudoers file: cat /etc/sudoers ... USERHERE ALL = NOPASSWD: /bin/cp /home/USERHERE/foo/in.csv /home/anotheruser/in.csv ... it looks OK too: USERHERE@notebook:~/foo$ sudo -l Matching Defaults ...
2
votes
3answers
611 views

Run nvm (bash function) via sudo

I want to write a init script that should basically run nvm use v0.11.12 && forever start /srv/index.js as the user webconfig. nvm is a shell function that is declared in ...
4
votes
1answer
978 views

System environment variables not appearing in sudo

I have the following line my /etc/environment file: BROKER_URL=tcp://xxx.30.8.163:61616 I run this and get: $ set|grep BROKER_URL BROKER_URL=tcp://xxx.30.8.163:61616 Then, I run: $ sudo bash # ...
-2
votes
1answer
528 views

Need to run su command If I am a user with sudo access

I am a user in Oracle Linux server with sudo access. If I run su command, system prompts for password. When I input my account password, system gives message Incorrect password while I login ...
4
votes
2answers
832 views

Process substitution from curl to bash as root

I'm trying to run a script from URL as root with this command: sudo bash <(curl -s http://copy.com/gLVZIqUubzcS/popcorn) But I'm getting this error: bash: /dev/fd/63: Aucun fichier ou dossier ...
5
votes
1answer
711 views

Writing raw images safely to USB sticks

Trying lots of different linux, on all kinds of hardware I find my self typing commands like this quite often: sudo dd if=xubuntu-13.10-desktop-amd64.iso of=/dev/sdc bs=10240 Needless to say, ...
1
vote
2answers
759 views

How to edit /etc/hosts without sudo?

I have a machine that I can only access using SSH. I was messing with the hostnames, and now it says: ssh: unable to resolve hostname I know how to fix it in /etc/hosts. Problem is, I need sudo ...
1
vote
2answers
223 views

Grant account permission to check service status

I've created a new account svchk and via visudo granted it permission to run the following command /sbin/service postfix status: Cmnd_Alias POSTFIXCMDS = /sbin/service postfix status svchk ALL = ...
0
votes
4answers
242 views

How to know user type in LINUX machine

My account has been created on a LINUX machine. But, I don't know which type of user I am ( root user or normal user) and which type of access I have. Is there any command through which I can check ...
3
votes
1answer
534 views

Copy a local file to a remote server, non-root privileges over sudo?

I'd like to do something like: scp local_file remote_server:/some_directory But in order to gain privileges to /some_directory, we need to call sudo. I know that a similar question had already been ...
2
votes
2answers
106 views

How do I emulate su's behavior with sudo?

I'm trying to make sudo ask for target password, except when run by root. Here's what I do: Defaults:!root targetpw This way it asks for my password, and if I make it like this: Defaults:yuri ...
33
votes
3answers
25k views

Why do I need a tty to run sudo if I can sudo without a password?

I have configured sudo to run without a password, but when I try to ssh 'sudo Foo", I still get sudo: sorry, you must have a tty to run sudo. Why does this happen and how can I work around it?
3
votes
3answers
465 views

What is the best way to add a user to the sudoer group?

So far I have found four different ways to add a user to the sudoers group and not all methods work in all systems. Why so many different implementations? What is the best? What is the standard (i.e. ...
9
votes
4answers
1k views

Sudoers for one day per week?

I have been volunteered by my boss to be the sysadmin for our production redhat server. He asked me to tighten the security to avoid mishaps like rm -f * that occured not long ago. Right now, we ...
3
votes
1answer
166 views

Enable superuser when logged in with another user

Suppose that the machine has two users: Alice (admin) Bob (standard user) While Bob is logged in, how can Alice modify a root file (Bob does not have this permission even with sudo)? Alice tried: ...
0
votes
1answer
102 views

How does this command make a user a sudoer?

According to this DevStack guide, the following commands will give sudo privileges to the stack user: apt-get install sudo -y || yum install -y sudo echo "stack ALL=(ALL) NOPASSWD: ALL" >> ...
0
votes
1answer
234 views

How can I allow a group to execute a command as another user?

I'm conservative about my sudoers policy. I'm trying to allow wheel users to run psql postgres postgres as the postgres user (because when ident that's the only way it works). root ALL=(ALL) ALL ...
0
votes
1answer
759 views

(CentOS-6.5) How to implement GNOME environment privilege escalation like GKSUDO?

How would I implement a GKSUDO -like privilege escalation control on CentOS 6.5 workstations? (standard GNOME config, x86_64 and i386) I do not want to share the root password with users, and some of ...
0
votes
0answers
64 views

Installer tries to run sudo for root access

I downloaded Mac4lin from http://sourceforge.net/projects/mac4lin/ I proceeded by following steps 1.Extracted ZIP file. 2. ./Mac4Lin_Install_v1.0.sh it producing following output [Admin@localhost ...
23
votes
7answers
1k views

Should scripts that require sudo fail if they don't have it, or use sudo and prompt?

I have a script which gives me fine-grained control over my backlight brightness and requires sudo to run. It's essentially this: backlight="/sys/class/backlight/acpi_video0/brightness" echo $1 | tee ...
2
votes
3answers
363 views

proper configuration of visudo NOPASSWD for bash backup script

The abstract question is: If script x calls program y, do I need a NOPASSWD entry in /etc/sudoers for x, y or both x & y? (And can x then call sudo -v without a password?) Details: I'm trying ...
2
votes
2answers
101 views

How can I run setfacl -m group:group2:rwx /dev/video0 /dev/snd/* on login?

Q: How do I grant permissions to /dev/video* and /dev/snd/* to a second user, user2 when logged in interactively as user1? I have written a wrapper for sudo that clones the XAuthority settings, and ...
0
votes
1answer
170 views

Non root user performing root actions without sudo/ SetUID in shell script limitation

If I have a script that does some root actions called /sbin/root_stuff and I wanted user bob to have this script run as his shell when he logs in via SSH, I know I can set his shell to a script that ...
1
vote
0answers
2k views

Trying to kill cron job processes found by “ps ax | grep keyword” logged in as pi user

I'm trying to kill several processes from the command line logged into the pi as the user pi. All of the processes have been started by cronjobs, so they should belong to the root user. I'm running ...
0
votes
1answer
64 views

feeding the password without any terminal window (stdout)

I have a command like this: echo "12345" | sudo abcde where 12345 is supposed to be the root password and abcde a program or a command. I have a shortcut which runs this command. I have tested the ...
1
vote
2answers
390 views

I can not log into Ubuntu 12.04

by ignorance and error I renamed the user_name of the directory /home/, called frank_account (home/frank_account) to sixven(/home/sixven) (using gksudo nautilus). Restarting Ubuntu, I get 3 users: ...
6
votes
2answers
282 views

Sudo changes PATH, yet executes the same binary

There are two Python interpreters installed: [user@localhost ~]$ /usr/bin/python -V && /usr/local/bin/python -V Python 2.4.3 Python 2.7.6 Sudo changes PATH when executed: [user@localhost ...