Root user/sudo equivalent in Cygwin?

后端 未结 17 2258
旧时难觅i
旧时难觅i 2020-12-04 04:23

I\'m trying to run a bash script in Cygwin.

I get Must run as root, i.e. sudo ./scriptname errors.

chmod 777 scriptname does no

17条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-04 05:05

    Building on dotancohen's answer I'm using an alias:

    alias sudo="cygstart --action=runas"
    

    Works as a charm:

    sudo chown User:Group 
    

    And if you have SysInternals installed you can even start a command shell as the system user very easily

    sudo psexec -i -s -d cmd
    

提交回复
热议问题