Skip to content

Commit 911ed86

Browse files
committed
Changed visudo by an easier command to add the user to the sudoers group
1 parent c9e20dd commit 911ed86

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

guides/How To Deploy Python App Using uWSGI And Nginx.md

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,31 +62,12 @@ passwd johndoe
6262

6363
## Providing user with additional privilege
6464

65-
Since we will be logging in as `johndoe` for most of the time in the future, we will want it to have some "extra power", that is, temporarily acting as a super user. To do this, we need to run the command:
65+
Since we will be logging in as `johndoe` for most of the time in the future, we will want it to have some "extra power", that is, temporarily acting as a super user. To do this, we have to add the user to the sudoers group running the command:
6666

6767
```
68-
visudo
68+
usermod -aG sudo johndoe
6969
```
7070

71-
first, and we will see a text file popping up. Then we navigate to the lines containing:
72-
73-
```
74-
# User privilege specification
75-
root ALL=(ALL:ALL) ALL
76-
```
77-
78-
You can do this with the arrow keys. We need to add a new line for our user in this section:
79-
80-
```
81-
# User privilege specification
82-
root ALL=(ALL:ALL) ALL
83-
johndoe ALL=(ALL:ALL) ALL
84-
```
85-
86-
Remember that the `ALL` has to be **all uppercase**, otherwise it will raise syntax error.
87-
88-
After adding this line, use `ctrl + o` to save and press `ENTER` to overwrite, then press `ctrl + x` to quit.
89-
9071
## Enable SSH for our new user
9172

9273
Next, we want to allow us to login as `johndoe` using SSH, and we may also want to disable login as `root` from SSH to make our server more secure. To do this, use the command:

0 commit comments

Comments
 (0)