Editing
Basale infrastructuur
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== openssh server == Security vereist ssh toegang op basis van PKI. Aanpassen /etc/ssh/sshd_config PermitRootLogin no PasswordAuthentication no Firewall opzet voor ssh tegen brute force atacks: <pre> #!/bin/sh # # Variabelen en interfaces IPTABLES="/sbin/iptables" ext="eth0" int="eth1" # Beperk de toegang tot de externe interface (ext) # lijst="D A" for i in $lijst ; do $IPTABLES -${i} INPUT -i ${int} -p tcp --dport 22 -j ACCEPT ; $IPTABLES -${i} INPUT -i ${ext} -p tcp --dport 22 -m recent --update --seconds 600 --hitcount 7 --name SSH -j DROP ; $IPTABLES -${i} INPUT -i ${ext} -p tcp --dport 22 -m state --state NEW -m recent --set --name SSH -j ACCEPT ; $IPTABLES -${i} OUTPUT -p tcp --sport 22 -j ACCEPT ; done </pre> Door de rules eerst te verwijderen en daarna weer op te voeren is het script bruikbaar in combinatie met andere firewall scripts Tonen van de geregistreerde IP-adressen user@prod:~$ cat /proc/net/ipt_recent/SSH Wheezy en verder: user@prod:~$ cat /proc/net/xt_recent/SSH Flushen van de geregistreerde IP-adressen user@prod:~$ echo clear > /proc/net/ipt_recent/SSH user@prod:~$ echo / > /proc/net/xt_recent/SSH Een andere mogelijkheid tot hardening is de methode met "port knocking": http://en.wikipedia.org/wiki/Port_knocking Hardening met Boks:<br/> http://www.unixerius.nl/assets/media/BOKS-Paper-VJ2010.pdf<br/> http://www.unixerius.nl/assets/media/BOKS-Presentation-VJ2010.pdf<br/> http://www.kilala.nl/Sysadmin/index.php?id=2209<br/> === Goede key maken === ssh-keygen -t rsa -b 4096 ==== passphrase verwijderen ==== Voor unattended login: <pre> openssl rsa -in ~/.ssh/id_rsa -out ~/.ssh/id_rsa_new cp -p ~/.ssh/id_rsa_new ~/.ssh/id_rsa </pre> === ssh sessies open houden === Sommige verbindingen vertonen de onhebbelijke eigenschap de verbinding te laten vallen. Dit is op te lossen door de volgende regel aan /etc/ssh/ssh_config toe te voegen: ServerAliveInterval 60
Summary:
Please note that all contributions to Webhuis wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
Project:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Voorpagina
Cobol and PostgreSQL
PostgreSQL
CFEngine
Proxmox
Webhuis Kennisbank
Basale infra
Webhuis bouwstenen
Webhuis configuratie
Webhuis Infra
Webhuis Support
Webhuis Raspberry
Opzet Applicaties
Business Applicaties
Community portal
Current events
Recent changes
Random page
Help
sitesupport
Tools
What links here
Related changes
Special pages
Page information