Shell: Unterschied zwischen den Versionen

Aus Doc-Wiki
Zur Navigation springen Zur Suche springen
imported>Burghardt
imported>Burghardt
Zeile 1: Zeile 1:
 
{| style="border: 1pt black dashed"
 
{| style="border: 1pt black dashed"
 
|-
 
|-
| [[Image:Diamond-caution.png]] || Beta Test. Please give feedback. || [[Image:Diamond-caution.png]]
+
| [[Image:Diamond-caution.png]] || Beta Test. Please give feedback.<br />Most important: [[Shell#Port_knocking]] || [[Image:Diamond-caution.png]]
 
|-
 
|-
 
|}
 
|}
Zeile 59: Zeile 59:
   
 
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 ===
  +
* https://en.wikipedia.org/wiki/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.
  +
  +
{| style="border: 1pt black dashed"
  +
|-
  +
| [[Image:Diamond-caution.png]] || Secret: 33778 &bull; 22999 &bull; 44333 || [[Image:Diamond-caution.png]]
  +
|-
  +
|}
  +
  +
* Linux with knockd installed
  +
If you are using Linux and the package <tt>knockd</tt> 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; 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
  +
  +
The shorter form is given for reference only - it seems not to work reliable:
  +
~$ knock shell.stud.informatik.uni-goettingen.de 33778 22999 44333 ; sleep 1; ssh username@shell.stud.informatik.uni-goettingen.de
  +
  +
  +
* Linux without knockd
  +
...
  +
  +
* Windows PuTTY
  +
...
  +
  +
* Windows Command Line
  +
...
  +
  +
* OS agnostic Web Browser
  +
...
  +
  +
  +
  +
  +
  +
  +
  +
   
 
=== Additionally... ===
 
=== Additionally... ===
   
 
If you have problems to login take a look at this page. Probably we will limit access by further means soon...
 
If you have problems to login take a look at this page. Probably we will limit access by further means soon...
  +
  +
   
 
== Tips 'n' Tricks ==
 
== Tips 'n' Tricks ==

Version vom 8. Juni 2016, 14:07 Uhr

Diamond-caution.png Beta Test. Please give feedback.
Most important: Shell#Port_knocking
Diamond-caution.png


Usage

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

This term is misleading on this specific installation: the default algorithm being used is simply "round-robin" - you'll get connected to the "next" machine one after another. If you landed on an overcrowded system simply disconnect/reconnect to use another machine.

Legacy login.stud

Both login.stud.informatik.uni-goettingen.de and login.informatik.uni-goettingen.de (for staff only) are not affected by this new approach. These "old" machines will continue to work unmodified.

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. You need to kinit && aklog when you're approaching timeout


Self defense of the servers

Rate Limiting

Usually we do utilize "fail2ban" to chase brute force attacks by bad guys trying to hack login credentials. For technical reasons this is not possible for this "haproxy" approach. The workaround is:

Diamond-caution.png We do limit the rate of new ssh- (tcp-) connections from any given source IP address to 1 per minute. Diamond-caution.png

When you're going to login via ssh you usually have three tries to enter your password. Technically this is just one single connection! The next three tries come with the next connection, which is only possible after one minute. Trying to to log in too early gives just a generic error message:

~# ssh username@shell.stud.informatik.uni-goettingen.de
ssh_exchange_identification: read: Connection reset by peer

This behavior should be fine for most users where each one has a different IP address than other people.

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

Because the above limitations still allow too many brute force attempts we need to enhance security. For this a "port knocking daemon" got installed.

Diamond-caution.png Secret: 33778 • 22999 • 44333 Diamond-caution.png
  • 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; 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

The shorter form is given for reference only - it seems not to work reliable:

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


  • Linux without knockd

...

  • Windows PuTTY

...

  • Windows Command Line

...

  • OS agnostic Web Browser

...





Additionally...

If you have problems to login take a look at this page. Probably we will limit access by further means soon...


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

  • ...