You can use the following commands to run as another user or as root user. #1: runuser command The runuser command run a shell with substitute user and group IDs. This command is useful only when run as the root user : Only session PAM hooks are run, and there is no password prompt. If run as a non-root user without privilege to set user ID, the command will fail as the binary is not setuid. As runuser doesn’t run auth and account PAM hooks, it runs with lower overhead than su. The syntax is: runuser -l userNameHere -c 'command' runuser -l userNameHere -c '/path/to/command arg1 arg2' For example, as a root user you may want to check shell resource limits for oracle user, enter: # runuser -l oracle -c 'ulimit -SHa' OR check nginx or lighttpd web server limitations: # runuser -l nginx -c 'ulimit -SHa' OR # runuser -l lighttpd -c 'ulimit -SHa' Sometime, a root user can not browse NFS mounted share due to permission (secur...
Comments
Post a Comment