-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsudo.txt
27 lines (24 loc) · 834 Bytes
/
sudo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# become root
sudo -i
# which is like
sudo su -
# but ever so slightly better.
# ssh in and become root immediately:
$ ssh \e[32;1m-t\e[0m $host sudo -i
# \e[38;5;208m-t\e[0m for pseudoterminal, see \e[38;5;208mssh\e[0m
# make cron service start under WSL without sudo prompt
$ sudo visudo
# add at end:
%sudo ALL=NOPASSWD: /usr/sbin/service cron start
# or /etc/init.d/cron or something
# add user to sudoers
# normal OS
$ [sudo] adduser <user> sudo
# CentOS
$ usermod -aG wheel <user>
# let users do sudo things without a password
$ sudo visudo
# if it launches vi, reboot and export EDITOR=/bin/nano somewhere
# add this AT THE END OF THE FILE:
<username> ALL=(ALL) NOPASSWD: ALL
# because "When multiple entries match for a user, they are applied in order." and there's some group setting that comes near the end of the file.