CentOS7开机自启脚本 赋予 /etc/rc.d/rc.local 执行权限 chmod +x /etc/rc.d/rc.local 假设你的脚本路径为:/home/yan/script/autorun.sh,给其赋予执行权限 chmod +x /home/yan/script/autorun.sh 打开 /etc/rc.d/rc.local 文件,在末尾添加 /home/yan/script/autorun.sh