Aktionen

Per SSH auf AI-Lab-Rechner zugreifen: Unterschied zwischen den Versionen

Aus exmediawiki

Zeile 26: Zeile 26:
  
 
  $ sudo [[vi|vim]] /etc/ssh/ssh_config
 
  $ sudo [[vi|vim]] /etc/ssh/ssh_config
 +
 
die zwei zeilen in der Konfigurationsdatei:
 
die zwei zeilen in der Konfigurationsdatei:
 +
 
   # ForwardX11 no
 
   # ForwardX11 no
 
   # ForwardX11Trusted no
 
   # ForwardX11Trusted no
 +
 
wie folgt umändern:
 
wie folgt umändern:
 +
 
   ForwardX11 yes
 
   ForwardX11 yes
 
   ForwardX11Trusted yes
 
   ForwardX11Trusted yes
  
 
'''<big>2. sich über SSH auf Lab-Rechner einwählen (X-Forwarding)</big>'''
 
'''<big>2. sich über SSH auf Lab-Rechner einwählen (X-Forwarding)</big>'''
 +
 
  $ ssh -X unsername@IP-adress
 
  $ ssh -X unsername@IP-adress
 +
 
Output mit ''yes'' bestätigen
 
Output mit ''yes'' bestätigen
 +
 
  The authenticity of host 'IP (IP)' can't be established.
 
  The authenticity of host 'IP (IP)' can't be established.
 
  ECDSA key fingerprint is SHA256:KwHC3VDTosZC1utqoAm6o7H32HLxd7O2kIylld3PFLY.
 
  ECDSA key fingerprint is SHA256:KwHC3VDTosZC1utqoAm6o7H32HLxd7O2kIylld3PFLY.
 
  Are you sure you want to continue connecting (yes/no)?  
 
  Are you sure you want to continue connecting (yes/no)?  
 
  Please type 'yes' or 'no': ''yes''
 
  Please type 'yes' or 'no': ''yes''
 +
 
Passwort eintippen (der Cursor bleibt beim Tippen des Passworts still)
 
Passwort eintippen (der Cursor bleibt beim Tippen des Passworts still)
 +
 
  Warning: Permanently added 'IP' (ECDSA) to the list of known hosts.
 
  Warning: Permanently added 'IP' (ECDSA) to the list of known hosts.
 
  username@IPadress's password:
 
  username@IPadress's password:
  
 
Willkommensnachricht (Bsp):
 
Willkommensnachricht (Bsp):
 +
 
  Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)
 
  Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)
 
   
 
   
Zeile 52: Zeile 62:
 
   
 
   
 
  Last login: Fri Mar 29 12:38:20 2019 from 162.13.2.1
 
  Last login: Fri Mar 29 12:38:20 2019 from 162.13.2.1
 +
 
Jupyter Notebook starten (mit '''&''' Prozess in den Hintergrund setzen)
 
Jupyter Notebook starten (mit '''&''' Prozess in den Hintergrund setzen)
 +
 
  $ jupyter-notebook &
 
  $ jupyter-notebook &
  
Zeile 67: Zeile 79:
  
 
type in X-Term Fenster:
 
type in X-Term Fenster:
 +
 
  $ ssh -X unsername@IP-adress
 
  $ ssh -X unsername@IP-adress
 +
 
Output mit ''yes'' bestätigen
 
Output mit ''yes'' bestätigen
 +
 
  The authenticity of host 'IP (IP)' can't be established.
 
  The authenticity of host 'IP (IP)' can't be established.
 
  ECDSA key fingerprint is SHA256:KwHC3VDTosZC1utqoAm6o7H32HLxd7O2kIylld3PFLY.
 
  ECDSA key fingerprint is SHA256:KwHC3VDTosZC1utqoAm6o7H32HLxd7O2kIylld3PFLY.
 
  Are you sure you want to continue connecting (yes/no)?  
 
  Are you sure you want to continue connecting (yes/no)?  
 
  Please type 'yes' or 'no': ''yes''
 
  Please type 'yes' or 'no': ''yes''
 +
 
Passwort eintippen (der Cursor bleibt beim Tippen des Passworts still)
 
Passwort eintippen (der Cursor bleibt beim Tippen des Passworts still)
 +
 
  Warning: Permanently added 'IP' (ECDSA) to the list of known hosts.
 
  Warning: Permanently added 'IP' (ECDSA) to the list of known hosts.
 
  username@IPadress's password:
 
  username@IPadress's password:
  
 
Willkommensnachricht (Bsp):
 
Willkommensnachricht (Bsp):
 +
 
  Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)
 
  Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)
 
   
 
   
Zeile 85: Zeile 103:
 
   
 
   
 
  Last login: Fri Mar 29 12:38:20 2019 from 162.13.2.1
 
  Last login: Fri Mar 29 12:38:20 2019 from 162.13.2.1
 +
 
Jupyter Notebook starten (mit '''&''' Prozess in den Hintergrund setzen)
 
Jupyter Notebook starten (mit '''&''' Prozess in den Hintergrund setzen)
 +
 
  $ jupyter-notebook &
 
  $ jupyter-notebook &
  
Zeile 102: Zeile 122:
 
|[[Datei:Putty3.png|300px]] || [[Datei:Putty4.png|300px]]
 
|[[Datei:Putty3.png|300px]] || [[Datei:Putty4.png|300px]]
 
|}
 
|}
 +
 
<big>'''4. mit "Connect Once" einloggen und Passwort eintippen'''</big>
 
<big>'''4. mit "Connect Once" einloggen und Passwort eintippen'''</big>
  
 
Willkommensnachricht (Bsp):
 
Willkommensnachricht (Bsp):
 +
 
  Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)
 
  Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)
 
   
 
   
Zeile 122: Zeile 144:
  
 
<big>'''Rekursives Kopieren (Ordner+Inhalt)'''</big>
 
<big>'''Rekursives Kopieren (Ordner+Inhalt)'''</big>
 +
 
  $ scp -r ~/BspOrdner username@IPadress:/home/username
 
  $ scp -r ~/BspOrdner username@IPadress:/home/username
 
  $ scp -r username@IPadress:/home/username/BspOrdner ~/
 
  $ scp -r username@IPadress:/home/username/BspOrdner ~/

Version vom 2. April 2019, 13:32 Uhr

hilfreiche Kommandos

siehe auch: A-Z_Index_Kommandos

$ ssh username@IP-adress    # Login Lab-Rechner
$ ssh -X username@IP-adress # graphical Login (X Forwarding)
$ scp ~/Bsp.jpg uname@IP-adress:/home/uname # Dateien zwischen eigenem und Lab-Rechner kopieren
$ exit # Logout aus Lab-Rechner
$ cd # (Change Direction) sich durch den Rechner navigieren
$ ls # (list) aktuellen Verzeichnisinhalt anzeigen
$ mkdir foldername # Ordner anlegen
$ vim  # Bildschirmorientierter Editor
$ pwd # wo bin ich
$ whoami # wer bin ich
$ jupyter-notebook # Startet Jupyter Notebook
$ nautilus # startet Dateimanager

Workflows

detailllierte Info zu Secure Shell: https://wiki.ubuntuusers.de/SSH/

see also: https://pad.dyne.org/code/#/2/code/edit/WaPKydV-xJEjviFbrg6dvEho/

Von Linux zu Linux

1. eigene ssh Konfigurationsdatei öffnen & editieren

$ sudo vim /etc/ssh/ssh_config

die zwei zeilen in der Konfigurationsdatei:

  # ForwardX11 no
  # ForwardX11Trusted no

wie folgt umändern:

  ForwardX11 yes
  ForwardX11Trusted yes

2. sich über SSH auf Lab-Rechner einwählen (X-Forwarding)

$ ssh -X unsername@IP-adress

Output mit yes bestätigen

The authenticity of host 'IP (IP)' can't be established.
ECDSA key fingerprint is SHA256:KwHC3VDTosZC1utqoAm6o7H32HLxd7O2kIylld3PFLY.
Are you sure you want to continue connecting (yes/no)? 
Please type 'yes' or 'no': yes

Passwort eintippen (der Cursor bleibt beim Tippen des Passworts still)

Warning: Permanently added 'IP' (ECDSA) to the list of known hosts.
username@IPadress's password:

Willkommensnachricht (Bsp):

Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)

* Documentation:  https://help.ubuntu.com
* Management:     https://landscape.canonical.com
* Support:        https://ubuntu.com/advantage

Last login: Fri Mar 29 12:38:20 2019 from 162.13.2.1

Jupyter Notebook starten (mit & Prozess in den Hintergrund setzen)

$ jupyter-notebook &

Von Mac zu Linux

1. xquartz downloaden und installieren

Download-URL: https://www.xquartz.org/

2. xquatz starten (Finder > Programme > Dienstprogramme > XQuartz===)

ein kleines xterm fenster öffnet sich

3. sich über SSH auf Lab-Rechner einwählen (X-Forwardi===ng)

type in X-Term Fenster:

$ ssh -X unsername@IP-adress

Output mit yes bestätigen

The authenticity of host 'IP (IP)' can't be established.
ECDSA key fingerprint is SHA256:KwHC3VDTosZC1utqoAm6o7H32HLxd7O2kIylld3PFLY.
Are you sure you want to continue connecting (yes/no)? 
Please type 'yes' or 'no': yes

Passwort eintippen (der Cursor bleibt beim Tippen des Passworts still)

Warning: Permanently added 'IP' (ECDSA) to the list of known hosts.
username@IPadress's password:

Willkommensnachricht (Bsp):

Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)

* Documentation:  https://help.ubuntu.com
* Management:     https://landscape.canonical.com
* Support:        https://ubuntu.com/advantage

Last login: Fri Mar 29 12:38:20 2019 from 162.13.2.1

Jupyter Notebook starten (mit & Prozess in den Hintergrund setzen)

$ jupyter-notebook &

Von Windows zu Linux

1. Putty downloaden und installieren

Download URL: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

2. Putty starten

3. Verbindung erstellen (Verbindungsdaten eintragen)

Putty1.png Putty2.png
Putty3.png Putty4.png

4. mit "Connect Once" einloggen und Passwort eintippen

Willkommensnachricht (Bsp):

Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)

* Documentation:  https://help.ubuntu.com
* Management:     https://landscape.canonical.com
* Support:        https://ubuntu.com/advantage

Last login: Fri Mar 29 12:38:20 2019 from 162.13.2.1

Jupyter Notebook starten (mit & Prozess in den Hintergrund setzen)

$ jupyter-notebook &

Dateien kopieren zwischen Home-Rechner und Lab-Rechner

einfaches Kopieren

$ scp ~/Bsp.jpg username@IPadress:/home/username
$ scp username@IPadress:/home/username/Bsp.jpg ~/

Rekursives Kopieren (Ordner+Inhalt)

$ scp -r ~/BspOrdner username@IPadress:/home/username
$ scp -r username@IPadress:/home/username/BspOrdner ~/