Nguyễn Thành Huy
New member
How do I run a command as another user in Linux?
Answer
Linux Run Command As Another User
Answer
Linux Run Command As Another User
- runuser -l userNameHere -c ‘command’ runuser -l userNameHere -c ‘/path/to/command arg1 arg2’ runuser -u user — command1 arg1 arg2.
- su – su – username.
- su – root -c “command” OR su – -c “command arg1”
- su – root -c “ls -l /root”