fixed merge conflicts and small addings
[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 \pause
82 \begin{block}{\textasciitilde/.ssh/authorized\_keys}
83 \begin{lstlisting}
84 option1="option1value",option2="option2value"...optionn="optionnvalue" ssh-rsa\
85 AAAB4N.....
86 \end{lstlisting}
87 \end{block}
88 \pause
89 \begin{block}{Merk op}
90 alles in \textasciitilde/.ssh/ moet alleen leesbaar zijn voor de user.
91 \lstinline{chmod 600} dus
92 \end{block}
93 \end{frame}
94
95 \begin{frame}[fragile]
96 \frametitle{X forwarding}
97 \begin{block}{Nut}
98 Grafische programma's draaien op een machine die niet perse binnen
99 handbereik is.
100 \end{block}
101 \pause
102 \begin{block}{Command line vlag}
103 \lstinline{ssh -X frobnicator@foobarbaz.com}
104 \end{block}
105 \pause
106 \begin{block}{Config file}
107 \lstinline{ForwardX11 yes}
108 \end{block}
109 \pause
110 \begin{block}{Caveat}
111 Veiligheid
112 \end{block}
113 \end{frame}
114
115 \begin{frame}
116 \frametitle{Port forwarding}
117 \begin{block}{Nut}
118 Onversleutelde communicatie versleutelen
119 \end{block}
120 \pause
121 \begin{block}{Command line vlag}
122 \lstinline{ssh -L port:host:hostport frobnicator@foobarbaz.com}\\
123 \lstinline{ssh -R port:host:hostport frobnicator@foobarbaz.com}
124 \end{block}
125 \pause
126 \begin{block}{Config file}
127 \lstinline{LocalForward port host:hostport}\\
128 \lstinline{RemoteForward port host:hostport}
129 \end{block}
130 \end{frame}
131
132 \begin{frame}
133 \frametitle{Agent forwarding}
134 \begin{block}{Nut}
135 Je SSH cache meenemen naar een andere server
136 \end{block}
137 \pause
138 \begin{block}{Command line vlag}
139 \lstinline{ssh -A frobnicator@foobarbaz.com}
140 \end{block}
141 \pause
142 \begin{block}{Config file}
143 \lstinline{ForwardAgent yes}
144 \end{block}
145 \end{frame}
146
147 \begin{frame}
148 \frametitle{SOCKS proxy}
149 \begin{block}{Nut}
150 Al je internet verkeer via een \textit{vertrouwde} locatie laten lopen
151 \end{block}
152 \pause
153 \begin{block}{Command line vlag}
154 \lstinline{ssh -D port frobnicator@foobarbaz.com}
155 \end{block}
156 \pause
157 \begin{block}{Config file}
158 \lstinline{DynamicForward port}
159 \end{block}
160 \pause
161 \begin{block}{Instellen in Chromium}
162 \lstinline{chromium --proxy-server="socks5://host:8080" --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE host"}
163 \end{block}
164 \end{frame}
165
166 \begin{frame}
167 \frametitle{Instellen in Firefox}
168 Edit - Preferences - Advanced - Network - Settings
169 \includegraphics[width=200px]{./img/firefox_socks.png}
170 \end{frame}
171
172 \begin{frame}[fragile]
173 \frametitle{Compression}
174 \begin{block}{Nut}
175 Snelheid
176 \end{block}
177 \pause
178 \begin{block}{Command line vlag}
179 \lstinline{ssh -C frobnicator@foobarbaz.com}
180 \end{block}
181 \pause
182 \begin{block}{Config file}
183 \lstinline{Compression yes}
184 \end{block}
185 \end{frame}