⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 restricted.sh

📁 Shall高级编程
💻 SH
字号:
#!/bin/bash#  Starting the script with "#!/bin/bash -r"#+ runs entire script in restricted mode.echoecho "Changing directory."cd /usr/localecho "Now in `pwd`"echo "Coming back home."cdecho "Now in `pwd`"echo# Everything up to here in normal, unrestricted mode.set -r# set --restricted    has same effect.echo "==> Now in restricted mode. <=="echoechoecho "Attempting directory change in restricted mode."cd ..echo "Still in `pwd`"echoechoecho "\$SHELL = $SHELL"echo "Attempting to change shell in restricted mode."SHELL="/bin/ash"echoecho "\$SHELL= $SHELL"echoechoecho "Attempting to redirect output in restricted mode."ls -l /usr/bin > bin.filesls -l bin.files    # Try to list attempted file creation effort.echoexit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -