Setup ssh » Historie » Version 2
Jeremias Keihsler, 17.01.2019 10:04
1 | 1 | Jeremias Keihsler | h1. Configure ssh-server on a host |
---|---|---|---|
2 | |||
3 | h2. Requirements |
||
4 | |||
5 | To configure ssh you will need the following: |
||
6 | * a installed and supported operating system (e.g. Fedora 29) |
||
7 | * root-access |
||
8 | * a fast internet connection |
||
9 | |||
10 | h2. Preliminary Note |
||
11 | |||
12 | Some basic information may be found at |
||
13 | * http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-openssh-server-config.html |
||
14 | * http://wiki.centos.org/HowTos/Network/SecuringSSH |
||
15 | |||
16 | h2. Install ssh |
||
17 | |||
18 | usually @ssh@ is installed by default and the service is started up automatically |
||
19 | <pre><code class="bash"> |
||
20 | 2 | Jeremias Keihsler | dnf install openssh-server |
21 | 1 | Jeremias Keihsler | </code></pre> |
22 | |||
23 | h2. Configure ssh |
||
24 | |||
25 | <pre><code class="bash"> |
||
26 | vim /etc/ssh/sshd_config |
||
27 | </code></pre> |
||
28 | |||
29 | <pre> |
||
30 | # Prevent root logins: |
||
31 | PermitRootLogin no |
||
32 | |||
33 | AllowUsers alice bob |
||
34 | |||
35 | PubkeyAuthentication yes |
||
36 | PasswordAuthentication no |
||
37 | </pre> |
||
38 | |||
39 | after doing some changes you will have to restart the service |
||
40 | <pre><code class="bash"> |
||
41 | systemctl restart sshd.service |
||
42 | </code></pre> |
||
43 | |||
44 | h2. ssh-service |
||
45 | |||
46 | <pre><code class="bash"> |
||
47 | systemctl enable sshd.service |
||
48 | systemctl is-enabled sshd.service |
||
49 | </code></pre> |
||
50 | should result in |
||
51 | <pre><code class="bash"> |
||
52 | enabled |
||
53 | </code></pre> |