You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/How To Deploy Python App Using uWSGI And Nginx.md
-54Lines changed: 0 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,60 +68,6 @@ Since we will be logging in as `johndoe` for most of the time in the future, we
68
68
usermod -aG sudo johndoe
69
69
```
70
70
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
-
125
71
# Configuring Postgres
126
72
127
73
Postgres allows from the start a user to access a database with its own name. Thus we must:
0 commit comments