18.6. su - run a shell with substitute user and group IDs

简介:

Change the effective user id and group id to that of USER.

[neo@development ~]$ su - root
		
[neo@development ~]$ su root -c "rm -rf linux/"	
		
		
su - www -c "/srv/apache-tomcat-www/bin/startup.sh"
su - www -c "/srv/apache-tomcat-m/bin/startup.sh"

su - www -c "/srv/java/bin/java -jar /www/netkiller.cn/api.netkiller.cn/api.netkiller.cn-0.0.2-SNAPSHOT.jar &"
		




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
5月前
|
存储 关系型数据库 MySQL
The user specified as a definer (‘root‘@‘%‘) does not exist
The user specified as a definer (‘root‘@‘%‘) does not exist
|
网络安全
无法启动ssh:/run/sshd must be owned by root and not group or world-writable.
无法启动ssh:/run/sshd must be owned by root and not group or world-writable.
261 0
无法启动ssh:/run/sshd must be owned by root and not group or world-writable.
|
关系型数据库 MySQL
The user specified as a definer (‘root‘@‘%‘) does not exist(已解决)
The user specified as a definer (‘root‘@‘%‘) does not exist(已解决)
375 0
The user specified as a definer (‘root‘@‘%‘) does not exist(已解决)
check_user_createdate.sh
在前面这篇文章Linux如何找出用户的创建时间里面讨论了查看用户创建时间的方法,后面自己尝试弄了一个脚本来检查所有用户创建时间脚本,当然更合理的应该叫检查所有用户的密码修改时间比较准确(因为这种方法有条件限制),期间和夕照讨论了一下如何用shell脚本实现,获益良多。
629 0
|
MySQL 关系型数据库 数据安全/隐私保护