Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 如何在系统启动时保持运行chmod_Linux_Ubuntu_Systems Programming - Fatal编程技术网

Linux 如何在系统启动时保持运行chmod

Linux 如何在系统启动时保持运行chmod,linux,ubuntu,systems-programming,Linux,Ubuntu,Systems Programming,我使用运行级别在系统启动时运行我的chmod,但它只运行一次,如何允许chmod在系统启动时继续运行?有人能帮忙吗?我正在使用ubuntu 16.04。不要以这种方式使用chmod。从长远来看,它会造成很多痛苦,并会把你的盒子变成一个虫子坑。你想在那里做的是一个巨大的安全隐患 如果希望用户能够写入特定位置,请使用适当的文件系统访问权限。为能够写入该目录的人创建一个新组,将其权限设置为1775(所有者和组rwx,其他rx,粘性位启用),并将目录拥有组设置为以前创建的组。然后将所有能够写入该目录的用

我使用运行级别在系统启动时运行我的chmod,但它只运行一次,如何允许chmod在系统启动时继续运行?有人能帮忙吗?我正在使用ubuntu 16.04。

不要以这种方式使用
chmod
。从长远来看,它会造成很多痛苦,并会把你的盒子变成一个虫子坑。你想在那里做的是一个巨大的安全隐患


如果希望用户能够写入特定位置,请使用适当的文件系统访问权限。为能够写入该目录的人创建一个新组,将其权限设置为
1775
(所有者和组rwx,其他rx,粘性位启用),并将目录拥有组设置为以前创建的组。然后将所有能够写入该目录的用户添加到此组。

为什么不使用cronjob呢?您可以将此脚本(仅chmod行)设置为每分钟运行一次


当系统启动时,Crontab不是也运行一次吗?但是如果Crontab每秒钟都运行一次,是否有可能?使用Crontab,您可以定期运行脚本。但是你应该考虑一下你的配置,因为DeNeW狼提出并解决了这个问题,我不知道怎么做,因为我是Linux操作系统的新手。谷歌“Apache默认上传文件许可”怎么样?
#! /bin/sh


# Carry out specific functions when asked to by the system
 case "$1" in
  start)

  chmod a+rwx /var/www/html/Images/*
  echo "success"
  ;;
  stop)
  ;;
  *)
  echo "Usage: /etc/init.d/image {start|stop}"
  exit 1
  ;;
  esac