大网数据广告活动
服务器运维问答

Create a Web User

· 52CE 我爱测

I am running Apache 2.4.8 on Arch Linux, but that doesn't matter really. I would like to create a user who is devoted to web management. I have created a user, a group, and added the user to the group. How can I add a line with v…

问题原文

原帖链接 · Tim Palmer · CC BY-SA 3.0

I am running Apache 2.4.8 on Arch Linux, but that doesn't matter really.

I would like to create a user who is devoted to web management. I have created a user, a group, and added the user to the group. How can I add a line with visudo to allow him to control the web based services?

I have the ownership of the web root set up correctly, but I need group "web" to be allowed to use "service.httpd", "apachectl", and other web programs.

What I have: %web ALL=(ALL) /usr/bin/httpd

已采纳解答

原帖链接 · LinuxNinja · CC BY-SA 3.0

You've started off correctly. The line you have added needs to contain all the commands, exactly as they should be typed, separated by commas. You might also want to have the user NOT have to enter their password each time they use sudo, but that's up to you:

%web ALL=(ALL) NOPASSWD: service httpd restart, apachectl status, apachectl reload

These are just wrong examples. You will want to include the complete pathname to each command along with any parameters you require the user to use. The downside is that any commands that take multiple parameters have to be specified in the same order using the same syntax you use in your sudoers line. Commands that don't require parameters are easy.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-01-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。