云服务器内容精选

  • 在线仿真系统配置 新增用户组。 sudo groupadd user-creators sudo groupadd change-vt sudo groupadd user-switch sudo groupadd x11vnc-owner sudo groupadd change-owner sudo groupadd find-files sudo groupadd LimitedAdmins sudo groupadd netstat-watcher 将Octopus添加到组。 sudo usermod -aG user-creators Octopus sudo usermod -aG change-vt Octopus sudo usermod -aG user-switch Octopus sudo usermod -aG x11vnc-owner Octopus sudo usermod -aG change-owner Octopus sudo usermod -aG find-files Octopus sudo usermod -aG LimitedAdmins Octopus sudo usermod -aG netstat-watcher Octopus 修改sudoers文件。 nano /etc/sudoers # 将内容加到ALL=(ALL:ALL) ALL下面 # 添加前最好查询下每个命令的位置,例如 whereis chvt,将命令的地址修改为对应环境的地址 ########## # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL ########## %user-creators ALL=(ALL) NOPASSWD: /usr/sbin/useradd %change-vt ALL=(ALL) NOPASSWD: /bin/chvt %user-switch ALL=(ALL) NOPASSWD: /bin/su %x11vnc-owner ALL=(ALL) NOPASSWD: /usr/bin/x11vnc %change-owner ALL=(ALL) NOPASSWD: /usr/bin/chown %find-files ALL=(ALL) NOPASSWD: /usr/bin/find %LimitedAdmins ALL=(ALL) NOPASSWD: /bin/systemctl %netstat-watcher ALL=(ALL) NOPASSWD: /usr/bin/netstat 如果之前服务器上配置了supervisor,需要停止。 systemctl stop supervisor systemctl disable supervisor 只允许特定用户Octopus使用su命令。 sudo groupadd su-users sudo groupadd su sudo usermod -aG su-users Octopus sudo dpkg-statoverride --update --add root su 4750 /bin/su sudo chgrp su-users /bin/su 父主题: 在线仿真配置