Setup ssh » Historie » Version 2
Jeremias Keihsler, 13.01.2017 13: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. CentOS 6.x) |
||
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 | yum install openssh-server |
||
21 | </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 | service sshd restart |
||
42 | </code></pre> |
||
43 | 2 | Jeremias Keihsler | |
44 | h2. ssh-service |
||
45 | 1 | Jeremias Keihsler | |
46 | <pre><code class="bash"> |
||
47 | chkconfig --list sshd |
||
48 | </code></pre> |
||
49 | should result in |
||
50 | <pre><code class="bash"> |
||
51 | sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off |
||
52 | </code></pre> |