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
1
vote
1 answer

running commands as other users - best method

When running commands as other users from the command line, what is recommended best practice? In the past I've used sudo like so: sudo -u username command [args] I've been told (with no specific reasons why) that using sudo for this purpose is…
RaWkStAr
  • 33
  • 8
1
vote
2 answers

How can I create an “su” only user (no SSH or SFTP) and limit who can “su” into that account in RHEL5?

Possible Duplicate: How can I allow one user to su to another without allowing root access? We have a user account that our DBAs use (oracle). I do not want to set a password on this account and want to only allow users in the dba group to su -…
Belmin Fernandez
  • 10,799
  • 27
  • 84
  • 148
1
vote
1 answer

Changed Password Won't seem to work for account

Bit of an odd problem. I've got a server I can SSH into as one of two logins: root or erik. Once I've logged in as erik I've tried to switch to the root user: # sudo su - root Password: And entered the password. After several failures I thought I…
erik
  • 89
  • 1
  • 1
  • 2
1
vote
1 answer

.bashrc doesn't get sourced after su'ing to root

I've got a CentOS 5.6 VPS and both root and my normal user account have identical copies of a .bashrc file in their home directories. The file contains a few basic aliases, etc. If I login to root, root's copy gets sourced. If I login to myuser,…
Ian Dunn
  • 194
  • 13
1
vote
3 answers

Running a command a different user using `su` gives "standard in must be a tty"

I am using STAF to automate db2 interface testing with our product. I am able to run the command using su - db2inst1 -c "/home/db2inst1/sqllib/bin/db2 list database directory" but when I try the same command with the staf interface I am getting the…
Sanjeev
  • 11
  • 1
  • 1
  • 2
1
vote
4 answers

Execute root commands through ssh user

my goal is to execute commands as root user from another linux host through ssh. The Problem is: The environment doesnt allow to access the root user directly. The manual way, which works, is to connect to the unpriviliged user first by ssh-key,…
Troubadix
  • 11
  • 3
1
vote
2 answers

How do I run sudo commands with a system user?

I want to run a minecraft server in Docker, so I started following this guide. In the guide, it is advised to create a system user with a home directory (/opt/minecraft), but without a password (you should not be able to "login" with this user) to…
Roger
  • 111
  • 5
1
vote
1 answer

Can't run command under /bin/false user

Centos 8. There is snowuser: [snowuser@snowcannon-01 ~]$ cat /etc/passwd | grep snowuser snowuser:x:1002:1002::/home/snowuser:/bin/bash [snowuser@snowcannon-01 ~]$ groups snowuser wheel There is tomcat user: [snowuser@snowcannon-01 ~]$ cat…
Lesha Pipiev
  • 115
  • 3
1
vote
3 answers

Ubuntu 20.04: su command bash-autocomplete stopped working

I am using Ubuntu 20.04. The su autocomplete stopped working. For example when I type: su TabTab It lists the files and directories of the current directory, where as it should list the available users. Bash auto-complete for other commands is…
0
votes
0 answers

Can not su - root. su: incorrect password

I am trying to switch to root user using the su command. I am getting the following error $ su - root Password: su: incorrect password I checked the /var/log/messages and found the following: Dec 9 17:04:27 vSBC_OMM_L audispd: node=vSBC_OMM_L…
AndresM
  • 39
  • 1
  • 1
  • 5
0
votes
2 answers

Switching to a "role" account, using `sudo` and `ssh` agent forwarding later on – possible?

I want to create "role" accounts for several admin tasks that don't usually require root permissions. For example, consider a www-admin user maintaining files in /var/www. It seems to me that this is the easiest way to solve file permission issues:…
mp_de
  • 11
  • 1
0
votes
0 answers

Can you disable su for certain users logged in via ssh?

Basically, I'm running a Mac Mini as a server, and I'm trying to close some security holes. My server has 3 users: admin, git, and server. Each user has public key authentication enabled, while only git has password authentication enabled. However,…
0
votes
1 answer

Sudo not working. How to reset root password Ec2 (AWS)

I installed a SSL certificated the day before. Today I wanted to log in to the server. When I try to "sudo" it gives me the following error message: sudo: unable to stat /etc/sudoers: No such file or directory sudo: no valid sudoers sources found,…
0
votes
1 answer

User login without passwords

We have multiple users accounts with /bin/bash shell allocated to them. An another application "su" to these accounts for controlling their service statuses and monitoring purposes. Passwords for these users are not set though. What shall I do to…
Aso'K
  • 21
  • 6
0
votes
1 answer

RHEL7 - su - command error logging location

I am trying to understand if there is any logging happening for this command in any log file: $ su - user1 su: user user1 does not exist I checked /var/log/messages, /var/log/secure and /var/log/audit/audit.log, but couldn't find any message…
sb9
  • 103
  • 5
1 2 3
8 9