Shell: Unterschied zwischen den Versionen

Aus Doc-Wiki
Zur Navigation springen Zur Suche springen
imported>Burghardt
imported>Burghardt
Zeile 44: Zeile 44:
 
== Self defense of these servers ==
 
== Self defense of these servers ==
   
  +
<small>''09.06.2016: Strategic "Rate Limiting" removed</small>
  +
<!--
 
=== Rate Limiting ===
 
=== Rate Limiting ===
 
Usually we do utilize "<tt>fail2ban</tt>" to chase brute force attacks by bad guys trying to hack login credentials. For technical reasons this is not possible for this "<tt>haproxy</tt>" approach. The inconvenient workaround is:
 
Usually we do utilize "<tt>fail2ban</tt>" to chase brute force attacks by bad guys trying to hack login credentials. For technical reasons this is not possible for this "<tt>haproxy</tt>" approach. The inconvenient workaround is:
Zeile 61: Zeile 63:
   
 
If you are a group of students behind NAT this could be a problem. We need yet to find out if this might be a problem for students residential establishment in Göttingen.
 
If you are a group of students behind NAT this could be a problem. We need yet to find out if this might be a problem for students residential establishment in Göttingen.
  +
-->
   
 
=== Port knocking ===
 
=== Port knocking ===

Version vom 9. Juni 2016, 08:27 Uhr

Diamond-caution.png Beta Test. Please give feedback via feedback(ät)informatik.uni-goettingen.de.
Currently most important topic: #Port_knocking
Diamond-caution.png


Usage

Please read Shell#Port_knocking if you can not connect.


Simply use SSH to login to this machine:

ssh  user@shell.stud.informatik.uni-goettingen.de

Note that the intially presented banner contains something like

#######  shell.stud.informatik.uni-goettingen.de - login vm: shell5.cip.loc

...telling you the actual local name of the automatically chosen destination machine.


For Windows: use PuTTY (simple) or Cygwin (more complex and powerful) or any other SSH-implementation.


Target audience

These machines are meant to be used by students. But of course they can be used by any staff members! (For first time users: the only requirement is to logon one single time using one of the (physical) pool computers in our building - this will make you a "known user" to our systems.)

Load Balancing

While this term is misleading on this specific installation (as it does simple "round-robin") the important point is that you'll get connected to any login machine. This will be the "next" machine one after another and probably not the same one as one session before. If you landed on an overcrowded system simply disconnect/reconnect to use another machine.

Timeout

  • The session Timeout is set to 36 hours -- this is the HAproxy related Timeout regarding the TCP connection
  • Kerberos/OpenAFS have separate/shorter timeouts, usually 10 hours. Please check with klist. You need to run kinit && aklog when you're approaching timeout


Self defense of these servers

09.06.2016: Strategic "Rate Limiting" removed

Port knocking

Because the above limitations still allow too many brute force attempts we need to enhance security. For this a "port knocking daemon" got installed. It works like a secret knocking sequence at the door of a conspiracy meeting.

Only after you have successfully performed that secret sequence the door is opened for a moment. In our technical context this means that the listening sshd is reachable for 30 seconds after knocking...

Diamond-caution.png Secret: 33778 • 22999 • 44333 Diamond-caution.png


Successfully triggering is possible using a variety of software tools:


Linux with knockd installed

If you are using Linux and the package knockd is actually installed (which is not a requirement!) you can use this one-liner to log in:

~$ knock shell.stud.informatik.uni-goettingen.de 33778 22999 44333 && sleep 1;  ssh username@shell.stud.informatik.uni-goettingen.de

If this fails try a slower version:

~$ knock shell.stud.informatik.uni-goettingen.de 33778; knock shell.stud.informatik.uni-goettingen.de 22999; knock shell.stud.informatik.uni-goettingen.de 44333 &&  sleep 1;  ssh username@shell.stud.informatik.uni-goettingen.de

Linux without knockd

telnet to the rescue!

~$ telnet shell.stud.informatik.uni-goettingen.de 33778
~$ telnet shell.stud.informatik.uni-goettingen.de 22999
~$ telnet shell.stud.informatik.uni-goettingen.de 44333
~$ ssh  username@shell.stud.informatik.uni-goettingen.de


Knockknock.png

Windows

  • telnet is included in Windows also. But it is not installed by default. You need to activate it through "Windows-Features aktivieren oder deaktivieren"/"Add windows features" --> "Telnet-Client". You need Administrator privileges to do so, so this is not an option on foreign computers
  • There are dedicated tools available for this purpose. This one is tested and found to work as expected: https://sourceforge.net/projects/knockknock/
    The zip-file contains a (surprisingly small) executable. It is usable without installation, so you do not need Admin privileges
  • Use a web browser to tickle those ports

 
 

OS agnostic Web Browser

Create a new folder for these bookmarks. Prepare three Bookmarks:

Of course you will end up running into a timeout as there is no webserver listening. You do not have to wait for timeout; simply cancel loading...

You can "click" them one after another. Browsers like Firefox offer a context menu entry "Alle in Tabs öffnen"/"Open all bookmarks" which tries to do what it says. You need to close all three of them one by one though.

Additionally...

If you have problems to login take a look at this page. These security aspect a definitely a work in progress and the final state is not being reached yet...

Tips 'n' Tricks

Connect to a specific machine

Circumventing the Round-Robin mechanism is possible: connect to a specific port 42000+n with n={1..6} :-)

For machine number 4:

~$ ssh -p 42004 username@shell.stud.informatik.uni-goettingen.de
#######
#######  shell.stud.informatik.uni-goettingen.de - login vm: shell4.cip.loc

Todo

  • Testing! -- current state considered "BETA"
  • make Status Information publicly available

See also


Links