1
vote
3answers
157 views

How to exit the super user from middle of shell script?

I have a shell script in which most of the commands need to be run under sesu user and then I need to run some commands as current user. Can you please help me in this?
3
votes
1answer
157 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 ...
2
votes
2answers
609 views

Understanding homebrew 'no-sudo' philosophy and questioning FAQ

Having fresh install of OS X, I decided to install python package manager in proper way. So I started googling and found homebrew is the best way. Now I got two questions: from homebrew FAQ: ...
3
votes
1answer
6k views

How to change user in winSCP?

I'm using winSCP to access Unix computers. How can I change user after I have logged into a Unix server using winSCP? E.g. I have personal account in unix computer A. I can log into this comp using ...
0
votes
3answers
1k views

Change owner of the root folder and subfolders (Ubuntu 13.04)

I accidentally set owner of root folder (/) and all subfolders to one user by command $ sudo chown -R 'userName' /* Now I wanna set owner back to root user by command $ chown -R root:root /* But ...
3
votes
1answer
312 views

sudo -k vs. sudo -K

I know what the man page has to say about the -K and -k : ‑K The ‑K (sure kill) option is like ‑k except that it removes the user's cached credentials entirely and may not be used in ...
0
votes
0answers
74 views

How to edit a remote file with implicit su-ing to another user on remote host

I want to edit files on Unix/Linux servers from my PC (running Linux and/or Windows). However due to security, I cannot log into the remote server as the file owner, but as my named user, then sudo su ...
0
votes
2answers
169 views

i want alice to run any command as root, but can not run commands as any other user

Say I have 2 users - 'alice' and 'bob' and want to allow 'alice' to run any command as root, but not run commands as 'bob' or any other user, am I able to do this, and if so how ? consider this ...
1
vote
1answer
927 views

Edit sudoers to allow /sbin/ifconfig down with NOPASSWD

I'm trying to edit /etc/sudoers so that I can execute a bash script with a root password. so far every edit I've tried to sudoers is not working. I've tried adding each of these lines: %admin ...
0
votes
2answers
684 views

running script containing sudo in cron

#!/bin/bash value=$(<man.txt) echo "$value" if [ "$value" == "true" ]; then echo "startedif_manthan" ps -ef|grep sym |awk '{ print $2 }'|sudo xargs kill -9; sleep 30; sudo sh ...
0
votes
5answers
45 views

My user information was deleted [duplicate]

Possible Duplicate: Undo an “rm -rf ~” command? So I made a stupid error, I did a sudo rm -rf of my ~/ directory. I wasn't thinking of the hidden files in there. Now instead of showing what ...
0
votes
4answers
136 views

how to access homedir by root user

I want to access root user's home directory /root/. However following commands dont lead me to the root directory. sudo -s cd ~ It leads to the home dir of regular user. How to access /root ...
1
vote
1answer
129 views

Trying to setup sudo user

I'm trying to setup sudo without no password but still I get prompted for password, I'm using ubuntu, here is the relevant line from the sudoers configuration file : gandalf ALL=(ALL:ALL) NOPASSWD: ...
1
vote
1answer
742 views

sudo access to view/edit a crontab

I wish to be able to edit, or at least view, a crontab that is on a server. Should I not be able to run this to do so: sudo crontab -u root When I do, I get this error: Sorry, user crmpicco is ...
5
votes
2answers
467 views

Feedback when typing password at a sudo prompt

When I type in my password at a sudo command line prompt, I would like to see a "*" for each keystroke. How do I do this?
0
votes
2answers
416 views

Protecting against sudo inside shell-scripts, makefiles, etc

Usually, when I run sudo, it will ask me to enter a password the first time and it will remember that I'm authenticated for the next few minutes, until that authentication times out. This leaves a ...
5
votes
1answer
583 views

What is the + at the end of Unix permissions in a long listing format?

Here's an example drwxr-xr-x+ 6 reza reza 204 Mar 5 20:23 .ssh/ Although I am the owner of this directory, I cannot modify it without using sudo! Why is that? how can I remove '+' here ...
1
vote
3answers
1k views

Sudo segmentation fault in Terminal [duplicate]

Possible Duplicate: Cannot do sudo: “/etc/sudoers is mode 0740, should be 0440” sudo: /etc/sudoers is mode 0640, should be 0440 Segmentation fault Any time I am trying to do ...
1
vote
1answer
166 views

How do I create a command to run with sudo?

I have created a file called svrestart in /home/gab/bin (which is a folder that should be automatically be added to path on startup) which contains: /etc/init.d/nginx restart /etc/init.d/php5-fpm ...
0
votes
2answers
75 views

Ubuntu 11 Desktop without an administrator user

Somehow I managed to change my user to a "standard" account, as opposed to an administrator account, and I don't have any access to sudo, or a backdoor account with admin rights. Is there anyway I ...
3
votes
1answer
7k views

What do the “ALL”s in the line “ %admin ALL=(ALL) ALL ” in Ubuntu's /etc/sudoers file stand for?

What does each ALL mean? I understand that the whole line indicates that the admin group members get admininstartive privileges, but would like to know more info about the position of the ALLS and if ...
2
votes
1answer
187 views

Unix User Group or Sudo/Su

I am in a situation where I have to chose between unix user groups or sudo to tackle an issue. To give some background, A Linux app is installed as user X. The installation copies some scripts and ...
2
votes
2answers
1k views

Permissions: Why do I always have to type 'sudo' before every command?

I'm editing theme files in a wordpress site owned by www-data:www-data as my main user 'oma'. Every time I create a file or edit one, I have to use the sudo command and it gets created as root:root. ...
0
votes
2answers
841 views

(How) Can I get a core dump when running a program with sudo?

Cores apparently are not dumped when the using sudo despite ulimit -c being set to unlimited. Is there any way around this?
8
votes
5answers
11k views

sudo chmod -R 777 /

sudo chmod -R 777 / I did this. It was a mistake. Is there any way to undo it? Basically it's messed up more things than I can list. I don't have time-machine enabled on my mac.
29
votes
2answers
5k views

What does the command “sudo !!” mean?

I saw the command sudo !! in a video. What does this mean?
1
vote
1answer
543 views

Installing a program in OS X using “make install” without being superuser?

I'm trying to install the Insight debugger on OS X with "make install" but my permissions aren't high enough and I'm always denied. Is there any way to install without having/being a superuser? I have ...
23
votes
3answers
41k views

How do I make sudo preserve my environment variables?

Using sudo 1.7.4p4 on Solaris 5.10 and sudo 1.6.7p5 on RHEL4 u6 I can't see how to preserve my environment variables, for instance $PYTHONPATH. I've added this line to sudoers, but it doesn't make any ...
0
votes
2answers
233 views

Get sudoers information for all users on a server

I want to collect information on what sudoers actions a user can perform on a server. From what I've read, you can do this with the command sudo -l -U username. However, one server that I have has a ...
1
vote
1answer
2k views

localhost in sudoers

There is no chance of an internal attack, so I would like to give sudo privileges to users at the local computer using sudoers. I tried these lines separately: %admin localhost=(ALL) NOPASSWD: ALL ...
3
votes
4answers
576 views

Why is my sudo generated file owned by root?

When I run '# sudo touch newfile' my expectation was that the file would be owned by me, not by root, as my understanding of sudo is that it is giving me, the user, root priviledges but does not ...
5
votes
1answer
662 views

Linux/Unix - how to enable one user to `sudo` without a password

How can a user be setup to sudo (or su -) without entering a password?
11
votes
3answers
11k views

UNIX - mount: only root can do that

I need to allow a non-root user to mount/unmount a device. I am a total noob when it comes to UNIX, so please dumb it down for me. I've been looking all over teh interwebz to find an answer and it ...
3
votes
3answers
431 views

*nix: Run as different user GUI

I want to run an application using only GUI as a different user. Not root. I want the user to be presented with a dropdown of system users, select one, enter the password, and the app gets run as ...
2
votes
2answers
4k views

How to configure sudoers with path wildcards?

I need sudo for a command for any path under a particular area. Example: sudo mycommand /opt/apps/myapp/... What is the sudoers syntax to allow this command to run in any path that falls under ...
21
votes
2answers
48k views

Command: sudo su -

I understand what su - does logs you into root with the root environment (as opposed to su which logs you into root with your environment) And I understand what sudo does you are root for one ...
4
votes
3answers
668 views

add myself back to sudo'ers list

i've got a computer running Ubuntu 9.10 Server, and i added myself to a new group using the following command: sudo usermod -G my_group me i learned that command removes me from all the groups i ...
2
votes
5answers
182 views

Creating a group in trying not to use Sudo nor 777

How can you create a group such that I can use programs of another user in the PC in my user account without 777 permissions nor with sudo? I created a new user by sudo adduser masi. I need either to ...
17
votes
9answers
13k views

What's the difference between the commands “su -s” and “sudo -s”?

What is the difference between the two super user commands, su -s and sudo -s? They both give a shell with access to the superuser account.