Home  >  Q&A  >  body text

linux - Ubuntu prompts permission denied when executing sh

My Baidu website said this works$ sudo chmod -R 777 myResources But it didn’t work after trying it. Is there any way to solve it?

怪我咯怪我咯2736 days ago849

reply all(4)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-16 13:25:36

    I want to authorize the script and then execute it

    chmod 777 ./redis.sh  

    Also when I saw you executing chmod时, 报错command not found! 这可能跟你执行sudo有关, 你可能没有配置好, 导致sudo时没有携带环境变量, 找不到命令, 你可以用绝对路径去执行, 或者不用sudo, 直接 chmod .....(省略)

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 13:25:36

    sudo sh mysql.sh

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 13:25:36

    One suggestion, if you use sh script this way, you may get into trouble. The default shell of ubuntu is dash, so an error will be reported~

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 13:25:36

    I also tried it like this. Why is there no response? chmod 777 ./redis.sh

    reply
    0
  • Cancelreply