root如何用apache的用户身份运行脚本
发表于 : 2016-11-07 9:05
因为apache的默认shell是/sbin/nologin,所以用su - apache "ls"运行程序的话会提示“This account is currently not available”。
遇到这种情况有解决办法吗?
谢谢!
遇到这种情况有解决办法吗?
谢谢!
代码: 全选
# cat /etc/passwd | grep sshd
sshd:x:105:65534::/var/run/sshd:/usr/sbin/nologin
# su -c "ls" sshd
This account is currently not available.
# su -s /bin/bash -c "ls" sshd
Apps bin Desktop Downloads etc incoming mnt tmp Videos