php服务器网络用户设置
我需要在我的 ubuntu 10.10 服务器上设置一个基本的 Web 用户帐户来托管网页。应限制该帐户仅访问计算机上必要的目录。我设置了以下帐户,但当我尝试登录时没有任何反应:
:~$ groupadd -g 1005 webgroup
//I then changed the group and permissions of a current user I had already created
:~$ sudo usermod -g 1005 -s /bin/false -d /home/webuser/ webuser
当尝试使用此帐户登录时,我输入用户名 [webuser] 和密码,但它只是将我重定向回登录:提示符。我尝试重置密码,但仍然遇到同样的问题。
有人可以告诉我我做错了什么,或者建议另一种可以达到相同结果的方法(如果不是更好的结果)。
I'm needing to setup a basic web user account on my ubuntu 10.10 server to host web pages. This account should be limited to access only the necessary directories on the machine. I setup the following account but nothing happens when I try to log into it:
:~$ groupadd -g 1005 webgroup
//I then changed the group and permissions of a current user I had already created
:~$ sudo usermod -g 1005 -s /bin/false -d /home/webuser/ webuser
When trying to login using this account I enter the username [webuser] and the password but it just redirects me back to the login: prompt. I tried resetting the password but still have the same problem.
Can someone either tell me what I'm doing wrong, or suggest another method that would achieve the same result (if not a better one).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现有两件重要的事情是正确的:
第一:我被重定向到登录提示符,因为 /bin/false 不是有效的 shell,因此无法执行 bash/sh 命令,并且会强制立即注销。
第二:安装 apache2 后,已经创建了一个名为
www-data
的用户,并具有我正在寻找的权限。我的印象是,用户必须不断登录计算机才能处理网络请求。事实并非如此(Windows 操作系统也是如此)。因此,让默认的www-data
用户处理所有请求才是正确的方法。I've found two important things to be true:
1st: I'm being redirected to the login prompt because /bin/false is not a valid shell therefore no bash/sh commands can be executed and an immediate logout is forced.
2nd: upon installing apache2 a user was already created named
www-data
with the permissions I was looking for. I was under the impression that a user had to be constantly logged into the machine for web requests to be handled. This is not the case (as it is with windows OS's). Therefore, letting the defaultwww-data
user handle all requests is the correct method.