Questions tagged [su]

Substitute User command

Run a command with substitute user and group id, allow one user to temporarily become another user. It runs a command (often an interactive shell) with the real and effective user id, group id, and supplemental groups of a given user.

man page

126 questions
10
votes
9 answers

Disable su on machine

Is there a way to allow su only for specified users (like using visudo for sudo). The reason for this is I'd like to keep a simple (weak) password for my root account and have accounts that can su/sudo only be able to login to the machine using a…
verhogen
  • 333
  • 2
  • 4
  • 14
10
votes
4 answers

Kernel Tuning with Privileged Docker Container

I'm building a container to tune kernel settings for a load balancer. I'd prefer to deploy those changes to the host in an image using a single privileged container. For example: docker run --rm --privileged ubuntu:latest sysctl -w…
allingeek
  • 262
  • 1
  • 2
  • 10
9
votes
2 answers

should use sudo or just su root in server management?

Which approach is better? For desktop usage, it seems that sudo is better since: I can have a more consistent history as a normal user Don't need to remember two passwords, which is especially true when I don't do administrative stuff…
weakish
  • 211
  • 2
  • 7
8
votes
2 answers

How to switch user given a UID?

I only know the UID of a user, is it possible to switch user using UID in linux distribution like we do using username like su -u someuser?
Vishrant
  • 243
  • 1
  • 3
  • 9
8
votes
4 answers

Can I sudo a command on behalf of another user?

I'm using drupal and Aegir. Aegir automates many tasks of site creation. Aegir has control of Apache, I'm logen in as root, and I want to restart the Apache server, but I want to do it on Aegirs behalf. Unfortunately I do not know the Aegir…
user379468
  • 181
  • 1
  • 1
  • 2
7
votes
2 answers

Setting up a user without a password

I'd like to be able to su to another user to run a script with reduced permissions. Unfortunately I have to type the password in every time, is there a way to create a user without needing the password prompt?
6
votes
1 answer

su: must be run from a terminal

I have tried to set up a scheduled backup of my Minecraft server. I used a script I found on GitHub at frdmn/minebackup.sh and it seems to work great when I run it from the terminal directly. The cronjobs I have set up however doesn't work for some…
Svish
  • 6,977
  • 15
  • 38
  • 45
6
votes
1 answer

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

Possible Duplicate: What is the difference between sudo -i and sudo su - I know both commands result in gaining a root-shell. But there are some differences. On some servers e.g. the prompt is different: nomike@testerver:~> sudo…
nomike
  • 63
  • 1
  • 3
6
votes
3 answers

using screen in another user with su

So, if i do this: su -c 'screen -dmS screenname script to run' - user to run as It won't work. The screen command is working if excecuted from root, so there is no problem there. If I do: su - user screen I get: Cannot open your terminal…
totokaka
  • 202
  • 2
  • 8
6
votes
2 answers

How to grant su access to wheel without asking for password on FreeBSD?

I would like to grant users of the wheel group (other sysadmins) su access without being asked for password. I know how to do it with pam in linux, but the question now is for FreeBSD. I am not familiar with the syntax for FreeBSD's PAM subsystem.…
cstamas
  • 6,707
  • 25
  • 42
6
votes
3 answers

SU and Run Command Using Expect

I want to su to another user, using expect, and then run a graphical program as that user. I am using kcalc to test with: #!/usr/bin/expect set timeout 20 spawn su dummy expect "Password:" send "PASS\r"; send "kcalc\r" I also tried eliminating the…
Sarah Cain
  • 61
  • 1
  • 2
5
votes
3 answers

SSH: su root or sudo?

What is the better option: Using su to switch to root or enabeling sudo? Without the use of sudo an intruder would need to know the password (or key) of a user allowed to ssh and then also the root password. With sudo the password of the…
Øle Bjarnstroem
  • 305
  • 4
  • 11
4
votes
1 answer

How to automatically switch to home directory when switching user?

When i ssh to my ubuntu server, i get logged in to my user's home folder. But when i do su otheruser and enter the password, i get logged in as the otheruser but the home directory stays for the previous user. How to automatically switch to the…
user2707590
  • 141
  • 1
  • 2
4
votes
2 answers

why does sudo su; su tomcat doesn't switch to tomcat user?

In Redhat linux. from my user if I issue command sudo su -> changes to root su tomcat --> changes to tomcat user Why does tailing the commands in single line doesn't work? sudo su; su tomcat --> stil in root. Doesn't switch to tomcat
prashanth
  • 141
  • 1
  • 1
  • 3
4
votes
1 answer

su between regular user accounts fails with "su: incorrect password"

user1 wants to su to user2 (both are non-root). When user1 runs su - user2, he's prompted for user2's password as expected, but the password is never accepted. user1@host $ su - user2 (switch from user1 to user2) Password: su: incorrect…
eschatonic
  • 43
  • 1
  • 1
  • 3
1
2
3
8 9