how to make PHP lists all Linux Users?

前端 未结 4 1582
轮回少年
轮回少年 2020-12-20 02:04

I want to build a php based site that (automate) some commands on my Ubuntu Server

first thing I did was going to the file (sudoers) and add the user www-data so I c

4条回答
  •  一生所求
    2020-12-20 02:40

    Like Matt S said, that's an incredibly bad idea to allow www-data root access on your server. The slightest compromise through your web applications could allow anyone full control of your system.

    A better idea would be to make separate scripts for specific accessions then use SUID permissions. This means, a specific user (in this case, www-data) can make small changes to the system through the execution of scripts. Still not a good idea, though. You may be able to work around it with suPHP but security is still a major concern.

提交回复
热议问题