The "substitute user" Unix command that changes the current user

learn more… | top users | synonyms

1
vote
1answer
533 views

Autologout after logging in

I have a Ubuntu 10.04 LTS server. I'm currently logged in as root, because I suddenly cannot log into my account anymore. When I execute su useraccount, nothing happens. The log file auth.log ...
1
vote
0answers
99 views

OS X: change root umask for su?

In recent versions of OS X (10.6+), the sudo command by default takes the "union" (bitwise or) of 0022 and the caller's user mask. This can lead to problems if the umask is more restrictive than 0022: ...
0
votes
2answers
476 views

Stuck In su in CentOS 6

I accidentally did su with no arguments while logged into the root account. It then put me into su and at the beginning of the command line, it now shows -bash-4.1# How do I "get out of" su ...
0
votes
0answers
289 views

Not able to log in as root in fedora 17

I am not able to log in as root in Fedora 17 Error is su: cannot set groups: Operation not permitted What to do to solve this error The permission has been changed to -rwxrwxrwx I want to ...
0
votes
0answers
58 views

Weird behavior of sudo

I use putty to log in to a remote LINUX machine. (Ubuntu 10) When I log in I have to authenticate myself, that goes on pretty smooth. Whenever I try to use sudo or su though, I experience ...
0
votes
1answer
118 views

Debian user keeps getting killed

I keep getting booted out of one of the user account on my Debian Squeeze server. At first I thought that it had something to do with SSH, but it still happens even if I log into another account and ...
0
votes
2answers
166 views

su misbehaves when executing a command that prompts for a password

I have 2 users in my debian server, gooduser and root. Command my_cmd prompts for a password (it connects to a ssh server). When I execute my_cmd as gooduser, everything works as expected: ...
2
votes
2answers
2k views

sudo, runuser, su don't work as I expect when run as root with command as “echo $HOME”

When I run these commands it outputs as shown. /root $ sudo -u someuser -i "echo $HOME" /root $ runuser -l someuser -c "echo $HOME" /root $ su - someuser -c "echo $HOME" /root What i expected ...
0
votes
1answer
240 views

su - user is not doing anything

I am entering to an Ubuntu Server using root, and I need to run a background process as a more limited user, so I write su -l limitedUser -c 'programName' But nothing happens. Even if programName ...
0
votes
3answers
783 views

No access to root thru su

I'm trying to access my PC as root su and it doesn't says root@something it says mypcname username # vi /something/ and in the normal terminal display says username@mypcname ~ $ someone that ...
0
votes
1answer
100 views

Configure environment after running su without hyphen

How would you go about setting up the correct environment variables and any other settings that should be set when using the su - username command, but without the hyphen? i.e. If I use su - ...
6
votes
3answers
846 views

Is it possible for root to execute a command as non-root

I am root user and suppose i want to run any application as another user. is it possible, without switching to another user. Something like # google-chrome user=abc I am actually executing a cli ...
2
votes
4answers
2k views

Accessing an exit code outside of a su -m $USER -c “<cmd>”

The below command prints "0" or "1" correctly depending on failure or not because i put $? inside the "su" command. sudo su -m $USER -c "./shutdown.sh &> /dev/null; echo \$?" However, if i ...
2
votes
2answers
167 views

gksu is a front end to su?

gksu manual page says that it is a front-end to su, however su doesn't need a command to be executed, while gksu does. Also, gksu doesn't seem to change the user ID of my shell, while su does. Is it ...
8
votes
2answers
3k views

Can't write to file /sys/class/backlight/acpi_video0/brightness (ubuntu)

I am trying to change the brightness by overwriting the value on this file: sudo echo 5 > /sys/class/backlight/acpi_video0/brightness -bash: /sys/class/backlight/acpi_video0/brightness: Permission ...
3
votes
2answers
1k views

Supply SU password in a bash script, within the script?

The purpose is to restart the machine if it doesn't get an abort command from the user. The problem is that the way the terminals are set up, user must supply SU password for shutdown, init, reboot, ...
19
votes
2answers
6k views

What's the difference between “su” with and without hyphen?

I'm quite new to Linux terminal and I'm not quite sure what the difference between su with a hyphen and su without a hyphen is, for example: su - username vs. su username. I looked into the ...
0
votes
1answer
170 views

Cannot use `su` or `sudo` after set up key-based access to SSH

I'm following this tuturial to setup key-based access to the SSH I created a user. I add copy the key to the client via ssh-copy-id <username>@<host> Becasuse ssh ...
2
votes
2answers
490 views

Is there a way to remove root requirements for a specific command in linux? If yes, how so?

I'm using Ubuntu 12.04 LTS, and I'm trying to make it so that the specific command dhclient doesn't require root privileges. I've done some research that leads me to believe I could unlock an "su" ...
1
vote
3answers
564 views

Use sudo command for script SSH server

I have to do following steps on several servers: log in with my username type in sudo su - type in amCLI -l 32/1 | grep Firmware So I would like to write this all in one script, my idea was: ...
0
votes
2answers
222 views

In Solaris how do you startup a script automatically without user input?

I'm using Oracle Solaris, and i would like to startup a script automatically everytime i turn on my computer and log into the desktop, however the script i want to run requires elevated permission, so ...
2
votes
3answers
6k views

Trouble setting up PATH for Java on Debian

I am trying to get Oracle Java 7 update 3 working correctly on Debian 6. I have downloaded and set up the files in /usr/java/jre1.7.0_03. I have also set the following two lines at the end of ...
1
vote
1answer
167 views

su - for some users

in a linux system with su - any user (with root password) can get root privileges. how I can restrict to some users ? // similar to AllowUsers in sshd_config
3
votes
1answer
2k views

Use su to switch to a local (mutually-trusted) user, without a password?

I'm curious if there is a way to enable one user to login (via su) into another user, without needing to know that users password. For instance, if I'm logged in as user1, I would like to give user2 ...
0
votes
1answer
194 views

sudo makes me “lose” permissions when running a script?

I have a script that I need to run. It is kicking off a java program. When I run it as me, it seems to work fine. If I type "sudo myscript.sh" it does not run fine. In reality, I need to run it as ...
2
votes
2answers
1k views

How can I automatically pass the password to 'su'?

I am working on an exploit for a security course. The object is to obtain a root shell in a linux virtual machine. So far, I can write to /etc/passwd and change root's password to an arbitrary string. ...
1
vote
1answer
1k views

How to get the env vars I want with the superuser command?

I'm running OpenSuse 12.1 KDE. I was previously running Ubuntu. In Ubuntu there was a superuser option (sudo -s) that preserved the original user's HOME env var (and another option, sudo -i, that set ...
2
votes
1answer
4k views

How can i block su access to some users only in linux

I want to configure pam in a way so that my some users can su to only some user. In RHEL4, I used /etc/pam.d/su auth required /lib/security/$ISA/pam_stack.so service=system-auth auth ...
1
vote
2answers
271 views

Best way to store root passwords

I have over ten web servers to manage and configure, with each server having its own root user and password. I have to maintain a database of all the root passwords on my development machine, but I ...
2
votes
1answer
239 views

Root authentication with another root user

I have a PC at work running Fedora 14. For some reason, the IT guys do not give out the password for the root user, but instead, if needed they create a specific suXXX user with root permissions. The ...
1
vote
1answer
326 views

Fedora 15 su user problem

I'm new to Fedora 15 and Linux. I've stumbled upon a problem while installing Oracle XE; I can't set environment variables or do anything else - any change I make won't stick. I'm using the terminal: ...
3
votes
1answer
2k views

What's the difference between sudo su - and sudo -i?

It is my understanding that they do the same: they ask for my password (if I am allowed in /etc/sudoers), and give me a login shell as root. Is there any difference between them? sudo su - sudo -i ...
0
votes
3answers
3k views

Linux PuTTY - automate su for password related issue

I am connecting to a server via PuTTY as follows: putty.exe -ssh user@host -pw password -noagent -m commands.txt After that I have to use: su someUser It will ask for a password - I have put ...
2
votes
3answers
1k views

How do I su to user login shell directly

I do the following many times a day I login to a server via ssh as user1, I then do su - to become root, then I do su --login user2 to become user2 Is there a way to tell su to go to user2 ...
1
vote
3answers
3k views

How can I find out what password I need to use for 'su'?

I am using Mac OS X 10.5, and have my account set up so that I don't need to login. When I go to Network Preferences and click the lock icon on the lower left corner, I am prompted for my username and ...
2
votes
3answers
14k views

Automating the “sudo su - user” command

I want to automate sudo su - user from a script. It should then ask for a password.
3
votes
6answers
2k views

a safer no password sudo?

Ok, here's my problem - Please don't yell at me for being insecure! :) This is on my host machine. I'm the only one using it so it's fairly safe, but I have a very complex password that is hard to ...
6
votes
3answers
2k views

use gnu screen when ssh'ed as a user, but su as another

Below is what happens when trying to use gnu screen. Essentially, it all works fine until I su as another user. then I get a Cannot open your terminal '/dev/pts/7' - please check. error l413:~$ ssh ...
0
votes
2answers
3k views

su Admin on Mac OS X does not work as expected

I'm tring to install PostgreSQL on Mac OS 10.6.4 and I need to authenticate as an administrator. In the command line, I have: su Admin Password: shell-init: error retrieving current ...
1
vote
2answers
3k views

What happens to the environment when you run “su -c”?

What happens to the environment when you run "su -c"? The reason I ask, is this mysterious behavior: bash$ which firefox /usr/local/bin/firefox bash$ su - user -c "echo $PATH" ...
3
votes
1answer
791 views

Problems with bash path when using 'su'

In Ubuntu Lucid Lynx, I'm trying to do su -l user -c "foo.sh args" where foo.sh is an executable bash script on the PATH set in ~user/.bashrc. Unfortunately, this fails because it can't find ...
22
votes
3answers
53k 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 ...
2
votes
4answers
2k views

Any latest linux distro which gives full root access ( NO SUDO )?

Is there Any latest linux distro which gives full root access ( NO SUDO ) ? I want to use it for programming in which I have to use / file system very frequently. What I need is any good linux ...