曼联vs阿贾克斯比分,csapp,野苹果园
需求:
安装deb包,设置程序安装后启动,不需要root权限启动程序 | 不能用root权限启动
其他开机启动选项
方法:root临时降低权限
secuser=`who am i | awk '{print $1}'` #echo $secuser su $secuser -c <指令> > /dev/null 2>&1 & #这一条命令的执行权限是临时的,只在本条语句起作用 id -u # 结果为0,还是root用户权限
附: su --help
-c, --command command pass command to the invoked shell -h, --help display this help message and exit -, -l, --login make the shell a login shell -m, -p, --preserve-environment do not reset environment variables, and keep the same shell -s, --shell shell use shell instead of the default in passwd
以上这篇在linux shell脚本中root切换到普通用户执行脚本或命令的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
windows10 更新Ubuntu20.04 LTS的方法步骤
CentOS7运行.sh脚本提示syntax error: unexpected end of file的解决方法
网友评论