shell下root用户切换其他用户运行程序
2013-10-01 14:14
309 查看
工作中,一些程序,需要随机启动,但是不是以root用户运行,于是需要在rc.local中通过shell,从root用户切换到其他用户运行程序,命令如下:
su -c 'command' - user sudo -u peter /home/blue/hi.sh
[b]实例[/b]
在/etc/rc.d/rc.local中加入如下内容:#vi /etc/rc.d/rc.local su - oracle -c "/u01/app/oracle/product/9.2.0.4/bin/lsnrctl start" su - oracle -c "/u01/app/oracle/product/9.2.0.4/bin/dbstart start"
相关文章推荐
- Linux用户切换到root后运行图形程序报错(*GLib-GIO-CRITICAL **)
- 普通用户如何在程序中切换到root
- Linux 下以其他用户身份运行程序—— su、sudo、runuser
- 以root用户运行jenkins中shell命令
- windows 7下 run as 其他用户运行程序
- shell脚本中用指定用户运行程序
- linux 普通用户登录后,执行 shell脚本切自动输入密码切换到root
- Windows平台使用Python切换用户运行程序
- Linux系统下,如何将运行程序的用户从root转到一般用户?
- 如何“以其他用户身份运行”程序
- Linux 下以其他用户运行程序
- 破解android的root权限的本质是:在系统中加入一个任何用户都可能用于登陆的su命令。或者说替换掉系统中的su程序,因为系统中的默认su程序需要验证实际用户权限,只有root和 shell用户才
- Linux 命令 - su: 以其他用户和组 ID 的身份来运行 shell
- Android系统默认的su程序只能root和shell可以用运行su
- Win7系统中怎么在当前用户下以其他用户身份运行程序?
- sudo和用su切换至root用户运行命令的区别
- Android开发安全问题之防止页面被其他程序覆盖监听,提示用户程序转移后台运行
- linux下在root用户登陆状态下,以指定用户运行脚本程序实现方式
- 如何使PC上运行的程序不能退出,并且用户只能使用当前正在运行的程序。不能使用PC上的其他程序
- LINUX系统 不切换用户 指定用户的身份运行某一程序