Added questions and sshd_config
[linuxnijmegen-ssh.git] / truuk.tex
1 \begin{frame}[fragile]
2 \frametitle{Public key authentication}
3 \pause
4 \begin{block}{Nut}
5 Mogelijk geen wachtwoord en veiliger
6 \end{block}
7 \pause
8 \begin{block}{Command line vlag}
9 \lstinline{ssh -i ~/.ssh/keyfile frobnicator@foobarbaz.com}
10 \end{block}
11 \pause
12 \begin{block}{Config file}
13 \lstinline{IdentityFile ~/.ssh/keyfile}
14 \end{block}
15 \end{frame}
16
17 \begin{frame}[fragile]
18 \frametitle{Public key authentication}
19 \framesubtitle{Genereren van een sleutelpaar}
20 \begin{block}{\$ ssh-keygen}
21 \begin{lstlisting}
22 Generating public/private rsa key pair.
23 Enter file in which to save the key (/home/frobnicator/.ssh/id_rsa):
24 /home/frobnicator/.ssh/github
25 Enter passphrase (empty for no passphrase):
26 Enter same passphrase again:
27 Your identification has been saved in /home/frobnicator/.ssh/github.
28 Your public key has been saved in /home/frobnicator/.ssh/github.pub.
29 The key fingerprint is:
30 92:92:6e:b8:3f:d5:76:e8:1b:73:ed:97:c4:e5:87:ba frobnicator@foobarbaz
31 The key's randomart image is:
32 +--[ RSA 2048]----+
33 | |
34 | |
35 | |
36 | . . .|
37 | o o.S. . + |
38 | o ...+ .. + o|
39 | . o. oo.. .o ..|
40 | o. .+ .. o |
41 | .... .. Eo |
42 +-----------------+
43 \end{lstlisting}
44 \end{block}
45 \end{frame}
46
47 \begin{frame}[fragile]
48 \frametitle{Public key authentication}
49 \framesubtitle{Installeren van een sleutel}
50 \begin{block}{Publieke sleutel: \textasciitilde/.ssh/github.pub}
51 \begin{lstlisting}
52 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBrgcK05XzRRbtmPyXQner5ef8
53 suOAErDvInRDQbl2bjR0PGizL2t5lM9zE+mS0HHigteGLKma1NxVBBeam0CrodJN
54 BcW55x3LR/2fLSujUqcloQNwLUpD5da6eGg9yPo1fEaAOK1ssHGA30o6nmDEZEHy
55 PFgBtPwtDw5TPXPpzslaJx1u7CdeyzqpYsUycxzboy3GBcCsvG4nzD4C9vd0yk5o
56 jlDeECul4mwyg7NuEjltaY89RzrSa8NtqtURyg/JFQW2IVGe+oBXeTL/eQRuo1Nj
57 GhYyPm1VMVM+NvaYQZXxGfLpoDoP2V+deD+gP5DuC8WW4LSGnkHKhDEin0Yl foo
58 @foobarbaz
59 \end{lstlisting}
60 \end{block}
61 \pause
62 \begin{block}{Geheime sleutel: \textasciitilde/.ssh/github}
63 \begin{lstlisting}
64 -----BEGIN RSA PRIVATE KEY-----
65 9RnNnrD2DkJBqoX/Aph2wVZg1y/I8t27C7yPR66xUNyHWG4J+k+q7REhA/K4fvjl
66 NNvNtbc4EeNI+NxaaftH1qo6yBIF5yDwuEYKixeconLCeGl9/exdlyMyXbuuTrU9
67 d5DgKnWxgJPHnDjmwqTeX3A5S34m/qJKK67IF9WqedeHxeMKzMZYcZpcsFxdvHk/
68 ...
69 -----END RSA PRIVATE KEY-----
70 \end{lstlisting}
71 \end{block}
72 \pause
73 \begin{block}{Installeren op de server}
74 De inhoud van het publieke bestand moet in
75 \lstinline{~/.ssh/authorized_keys} komen te staan
76 \end{block}
77 \end{frame}
78
79 \begin{frame}[fragile]
80 \frametitle{Public key authentication}
81 \begin{block}{\textasciitilde/.ssh/authorized\_keys}
82 \begin{lstlisting}
83 option1="option1value",option2="option2value"...optionn="optionnvalue" ssh-rsa\
84 AAAB4N.....
85 \end{lstlisting}
86 \end{block}
87 \end{frame}
88
89 \begin{frame}[fragile]
90 \frametitle{X forwarding}
91 \begin{block}{Nut}
92 Grafische programma's draaien op een machine die niet perse binnen
93 handbereik is.
94 \end{block}
95 \pause
96 \begin{block}{Command line vlag}
97 \lstinline{ssh -X frobnicator@foobarbaz.com}
98 \end{block}
99 \pause
100 \begin{block}{Config file}
101 \lstinline{ForwardX11 yes}
102 \end{block}
103 \pause
104 \begin{block}{Caveat}
105 Veiligheid
106 \end{block}
107 \end{frame}
108
109 \begin{frame}
110 \frametitle{Port forwarding}
111 \begin{block}{Nut}
112 Onversleutelde communicatie versleutelen
113 \end{block}
114 \pause
115 \begin{block}{Command line vlag}
116 \lstinline{ssh -L port:host:hostport frobnicator@foobarbaz.com}\\
117 \lstinline{ssh -R port:host:hostport frobnicator@foobarbaz.com}
118 \end{block}
119 \pause
120 \begin{block}{Config file}
121 \lstinline{LocalForward port host:hostport}\\
122 \lstinline{RemoteForward port host:hostport}
123 \end{block}
124 \end{frame}
125
126 \begin{frame}
127 \frametitle{Agent forwarding}
128 \begin{block}{Nut}
129 Je SSH cache meenemen naar een andere server
130 \end{block}
131 \pause
132 \begin{block}{Command line vlag}
133 \lstinline{ssh -A frobnicator@foobarbaz.com}
134 \end{block}
135 \pause
136 \begin{block}{Config file}
137 \lstinline{ForwardAgent yes}
138 \end{block}
139 \end{frame}
140
141 \begin{frame}
142 \frametitle{SOCKS proxy}
143 \begin{block}{Nut}
144 Al je internet verkeer via een \textit{vertrouwde} locatie laten lopen
145 \end{block}
146 \pause
147 \begin{block}{Command line vlag}
148 \lstinline{ssh -D port frobnicator@foobarbaz.com}
149 \end{block}
150 \pause
151 \begin{block}{Config file}
152 \lstinline{DynamicForward port}
153 \end{block}
154 \pause
155 \begin{block}{Instellen in Chromium}
156 \lstinline{chromium --proxy-server="socks5://host:8080" --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE host"}
157 \end{block}
158 \end{frame}
159
160 \begin{frame}
161 \frametitle{Instellen in Firefox}
162 Edit - Preferences - Advanced - Network - Settings
163 \includegraphics[width=200px]{./img/firefox_socks.png}
164 \end{frame}
165
166 \begin{frame}[fragile]
167 \frametitle{Compression}
168 \begin{block}{Nut}
169 Snelheid
170 \end{block}
171 \pause
172 \begin{block}{Command line vlag}
173 \lstinline{ssh -C frobnicator@foobarbaz.com}
174 \end{block}
175 \pause
176 \begin{block}{Config file}
177 \lstinline{Compression yes}
178 \end{block}
179 \end{frame}