Skip to content

Commit f1c5c51

Browse files
committed
Removed unnecesary ssh config when user is in sudoers group in ubuntu 20.04
1 parent 911ed86 commit f1c5c51

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

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

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -68,60 +68,6 @@ Since we will be logging in as `johndoe` for most of the time in the future, we
6868
usermod -aG sudo johndoe
6969
```
7070

71-
## Enable SSH for our new user
72-
73-
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:
74-
75-
```
76-
vi /etc/ssh/sshd_config
77-
```
78-
79-
And we will be prompted with another text file. Navigate to the section which contains:
80-
81-
```
82-
# Authentication
83-
PermitRootLogin yes
84-
```
85-
86-
Press `i` on your keyboard to enter insert mode and change the `yes` to `no` to disallow login as root.
87-
88-
Next, look for a configuration called `PasswordAuthentication`:
89-
90-
```
91-
# Change to no to disable tunnelled clear text passwords
92-
PasswordAuthentication yes
93-
```
94-
95-
**Important:** make sure to set it as `yes` so that you can use your password to login in the future. It should be set to `yes` already, however, there are some platforms that enforces SSH key authentication and set it to `no` instead.
96-
97-
Then go to the bottom of the file and add the following lines:
98-
99-
```
100-
AllowUsers johndoe
101-
```
102-
103-
For this section, if you already have other users on the server, make sure to include them as well. On AWS, for instance, a user named `ubuntu` is initialized and used to login for the first time. If you choose to create a new user, say `johndoe`, then you will need to add them together into `AllowUsers`:
104-
105-
```
106-
AllowUsers johndoe ubuntu
107-
```
108-
109-
Otherwise, you will no longer be able to login as `ubuntu` in the future.
110-
111-
Next, press `Esc` to quit insert mode, press `:` (colon) to enable the command function and enter `wq` to write and quit (after hitting `ENTER` to confirm).
112-
113-
Some other useful vi commands are: `:q` to quit without modification and `:q!` to force quit and discard changes.
114-
115-
Finally, we use the command:
116-
117-
```
118-
service sshd reload
119-
```
120-
121-
to enable our modifications.
122-
123-
Now we've created a new user `johndoe` and enabled both its super user privilege and SSH access. Next, we'll be learning to link this user to our PostgreSQL database.
124-
12571
# Configuring Postgres
12672

12773
Postgres allows from the start a user to access a database with its own name. Thus we must:

0 commit comments

Comments
 (0)