-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcentos.txt
More file actions
70 lines (67 loc) · 2.01 KB
/
Copy pathcentos.txt
File metadata and controls
70 lines (67 loc) · 2.01 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
On Server:
- Install CentOS 9 Minimal
- 'su'
- Enter password
- 'groupadd docker'
- 'adduser remote'
- 'passwd remote'
- Enter password
- Repeat password
- 'usermod -aG wheel remote'
- 'usermod -aG docker remote'
- 'systemctl status sshd'
- Ensure sshd is running
- 'yum update -y'
- 'yum install nano -y'
- 'yum install policycoreutils-python-utils -y'
- 'yum install httpd-tools -y'
- 'yum install rsync -y'
- 'yum install yum-utils -y'
- 'yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo'
- 'yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin'
- 'yum install git -y'
- 'systemctl start docker'
- 'docker network create proxy'
- 'nano /etc/ssh/sshd_config'
- Change Port to 2200
Ensure 'PasswordAuthentication yes' is not commented out
Ensure 'PermitRootLogin no' is not commented out
Add 'AllowUsers remote'
Save file and exit
- 'semanage port -a -t ssh_port_t -p tcp 2200'
- 'mkdir /srv/media/shared'
- 'mkdir /srv/traefik'
- 'chown docker: /srv/traefik'
- 'systemctl restart sshd'
- 'systemctl status firewalld'
Ensure firewall is running
- 'firewall-cmd --add-port=2200/tcp --permanent'
- 'firewall-cmd --permanent --remove-service=ssh'
- 'firewall-cmd --permanent --zone=public --add-service=http'
- 'firewall-cmd --permanent --zone=public --add-service=https'
- 'firewall-cmd --reload'
- 'firewall-cmd --list-all'
Ensure ports 80, 443 and 2200 are open
- 'hostname -I'
Take note of the IP address
On External Computer
- 'ssh-keygen'
- Change filename to suit
- Enter password
- 'cat ~/.ssh/{filename}.pub'
- Copy the entire key
- 'ssh remote@{IP address} -p 2200'
- Enter password
- 'mkdir .ssh'
- 'nano .ssh/authorized_keys'
Paste the key in and press enter
Save file and exit
- 'chmod 700 ~/.ssh'
- 'chmod 600 ~/.ssh/authorized_keys
- 'sudo nano /etc/sshd/sshd_config'
Change to 'PasswordAuthentication no'
Save file and exit
- 'sudo systemctl restart sshd'
- Ctrl + D to exit
- 'ssh remote@{IP address} -p 2200 -i "~/.ssh/{filename}"'
Success!