Recent Post

Chạy lệnh trên WSL từ Windows

Mở file /etc/sudoers.d/ trong WSL thêm vào dòng sau
%sudo ALL=(ALL) NOPASSWD: /usr/sbin/service mysql *
Dòng này có nghĩa là cho phép chạy lệnh service cho mysql từ máy tính
Ở Windows chạy lệnh
wsl sudo lệnh_cần_chạy
Ví dụ: wsl sudo service mysql start
Có thể tạo trong file .bat rồi để file ở shell:startup để tự khởi động cùng Windows

0 Nhận xét