Archive/설치-세팅

WSL Ubuntu Sudo 권한 허용 및 서비스 자동 시작

은풍 2020. 4. 8. 19:52

- 윈도우10 pro, WSL, Ubuntu 18.04 에서 확인한 내용

/etc/sudoers 파일 내용 중

# User privilege specification
root        ALL=(ALL:ALL) ALL
WSL_USER_ID ALL=(ALL:ALL) NOPASSWD:ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD:ALL

 

: sudoers readonly 일 경우,

$ sudo bash
$ chattr -i /etc/sudoers
$ chmod u+w /etc/sudoers

 

: 윈도우 부팅 시 자동 시작,
- C:\Users\사용자계정\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
위 경로에 batch파일을 둔다.


ex) nginx 경우

wsl-nginx-service.bat

C:\Windows\System32\bash.exe -c "sudo service ngxin start"

 

반응형