Substitute User command

learn more… | top users | synonyms

9
votes
4answers
8k views

run script as user who has nologin shell

All I need to do is to run a specific script as a particual user who does have the nologin/false shell indicated in /etc/passwd. I would run the script as root and this should run as another user. ...
6
votes
2answers
3k views

Run command as Linux “system” user (shell = /bin/false)

I created a "system" user in Ubuntu 11.04 (adduser --system) for running certain cron jobs, but sometimes I want to test things out by manually running commands as that user. What's the easiest way to ...
4
votes
2answers
10k views

execute su -c over ssh

I am trying to check the BIOS version of a server over SSH, a command that requires root privileges: ssh remote-server su -c dmidecode but this of course fails with the error: standard in must ...
3
votes
3answers
249 views

What's the magic of the “sudo su”?

[demo@PHP_DEV_57 ~]$ sudo su [root@PHP_DEV_57 www]# Why I can switch to root by simply sudo su, what's the difference between sudo and su?
2
votes
2answers
2k views

Executing a command as a nologin user

I've recently set up my server so that my suPHP 'virtual' users can't be logged into by using this article My issue now is that before when I ran a rake command for my Ruby on Rails application ...
7
votes
2answers
276 views

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 ...
5
votes
1answer
602 views

What's the difference between “sudo su -” and “sudo -i”? [duplicate]

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 ...
2
votes
3answers
389 views

Why is local root able to su to any LDAP user?

We have an LDAP server set up with our Active Directory. When users login to a Linux machine with LDAP client installed as root, they are able to su - into any Active Directory account without ...
1
vote
2answers
3k views

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 ...
0
votes
1answer
270 views

What's the difference between sudo su - postgres and sudo -u postgres?

PostgreSQL users peer authentication on unix sockets by default, where the unix user must be the same as the PostgreSQL user. So people frequently use su or sudo to become the postgres superuser. I ...