多个用户,一个public_html目录

使用linux创build用户的新手 尝试去

  1. 安全的方式添加用户,限制用户可以做的损害
  2. 让webadmins的所有成员都可以访问public_html文件夹,因为项目通常是共享的
  3. 限制webadmins除了public_html文件夹(SFTP等)以外的任何其他目录
  4. 为我的public_html位置使用非标准path

我相信这是最好的

mkdir /nonstandard/path/public_html 

通过添加用户

 useradd -d /nonstandard/path/public_html -g webadmins -m someuser -p password 

使用ChrootDirectory来限制它们

问题
这是正确的,安全的方式吗? 用户共享主目录可以吗? 这怎么能改进?

  1. 仅限pipe理员用户限制SSH。 通过FTP允许普通用户,并在主文件夹中将其chroot。 vsftpd可以做到这一点。 您可以通过FTP使用SSL / TLS。
  2. mkdir /nonstandard/path/public_html; chgrep -R webadmins /nonstandard/path/public_html;chmod -R g+r /nonstandard/path/public_html; find /nonstandard/path/public_html -type d -exec chmod g=rwxs \{\} \+
  3. 你可以在apache中使用suEXEC 。 还configurationDocumentRoot
  4. 请参阅apacheconfiguration指令DocumentRoot 。