+ All Categories
Home > Technology > Was, SSH kann auch das?

Was, SSH kann auch das?

Date post: 18-Dec-2014
Category:
Upload: martin-leyrer
View: 702 times
Download: 0 times
Share this document with a friend
Description:
Tipps zum effizienteren Umgang mit und Empfehlungen zum sicheren Betrieb von ssh(d). Sichere Kommandozeile auch von unterwegs mit Mosh. SSH Zwei-Faktor-Authentifizierung mit “Google Authenticator”.
27
SSH
Transcript
Page 1: Was, SSH kann auch das?

SSH

Page 2: Was, SSH kann auch das?

Wer ist das da vorne?

Martin Leyrer IT Specialist aka. “Mädchen für Alles” bei einem int. IT-

Dienstleister

E-mail: [email protected] Twitter: http://www.twitter.com/leyrer Facebook: https://www.facebook.com/leyrer Blog: http://martin.leyrer.priv.at LinkedIn: http://at.linkedin.com/in/leyrer Xing: www.xing.com/profile/Martin_Leyrer usw. ;)

Page 3: Was, SSH kann auch das?

Mehrfache Verbindungen

~/.ssh/config

ControlMaster auto

ControlPath /tmp/ssh_mux_%h_%p_%r

Page 4: Was, SSH kann auch das?

Managing Master Connections

Master Connection aktiv:ssh -O check remote-host

Master Tag killen:ssh -O exit remote-host

Page 5: Was, SSH kann auch das?

Dateien kopieren scp nutzt bestehende Verbindungen

Bash kann remote tab completion bei installierter “Bash Completion”

Verbindungen können auch mit rsync, git, und vielen anderen Tools geteilt werden

Page 6: Was, SSH kann auch das?

Verbindungen wiederholen

~/.ssh/config

ControlMaster auto

ControlPath /tmp/ssh_mux_%h_%p_%r

ControlPersist 4h

Page 7: Was, SSH kann auch das?

Keine Paßwörter

$ ssh-keygen$ ssh-copy-id [email protected]

oderlokal ~/.ssh/id_rsa.pub nach remote ~/.ssh/authorized_keys

Page 8: Was, SSH kann auch das?

Windows kann das auch

http://www.chiark.greenend.org.uk/~sgtatham/putty/

Page 9: Was, SSH kann auch das?

Hostname Aliases

~/.ssh/config

Host demo

HostName ssh.example.com

Page 10: Was, SSH kann auch das?

Keine Benutzernamen

~/.ssh/config

Host demo

HostName ssh.example.com

User m3

Page 11: Was, SSH kann auch das?

Schlüsselwahl

~/.ssh/config

Host demo

HostName ssh.example.com

User m3

IdentityFile ~/.ssh/demo_rsa

Page 12: Was, SSH kann auch das?

Agenten-Weiterleitung

~/.ssh/config

Host *

ForwardAgent yes

Page 13: Was, SSH kann auch das?

Von Server zu Server

$ ssh ssh.example.com

m3@ssh % ssh remote.example.com

~/.ssh/config:

Host remotedemo

HostName remote.example.com

ProxyCommand ssh ssh.example.com -W %h:%p

Page 14: Was, SSH kann auch das?

sshfs

$ mkdir ssh_mnt

$ sshfs demo:tmp/ ssh_mnt/

Page 15: Was, SSH kann auch das?

Vim und scp URLs

gvim scp://ssh.example.com/demo.txt

Page 16: Was, SSH kann auch das?

Interactive Remote Commands

-t sorgt dafür, daß die Session steht bis das interaktive remote command beende wurde. (top, vim, nano, less, etc.)

Page 17: Was, SSH kann auch das?

Session logging

ssh demo | tee -a session.log

Page 18: Was, SSH kann auch das?

make faster

/etc/ssh/sshd_config:GSSAPIAuthentication no

Page 19: Was, SSH kann auch das?

Top Gear Tuning Tip

Test:yes | pv | ssh ssh.example.com "cat > /dev/null"

Tune:Compression yes

CompressionLevel 9

Page 20: Was, SSH kann auch das?

Web Proxies

Corkscrew

ProxyCommand corkscrew proxy.example.org 8080 %h %p

Page 21: Was, SSH kann auch das?

Lokale App, entfernter Dienst

~/.ssh/config:

LocalForward 4242 localhost:5432

Page 22: Was, SSH kann auch das?

Resilient Connections

TCPKeepAlive no

ServerAliveInterval 60

ServerAliveCountMax 10

Page 23: Was, SSH kann auch das?

Mosh

Client:sudo apt-get install mosh

Server:http://tinyurl.com/d8yyaew

Probleme:It's probably the locale

Page 24: Was, SSH kann auch das?

Google 2-factor Authentication

sudo apt-get install libpam-google-authenticator

Als User ausführen: google-authenticator

/etc/pam.d/sshd:auth required pam_google_authenticator.so

/etc/ssh/sshd_config:ChallengeResponseAuthentication yes

Page 25: Was, SSH kann auch das?

https://cryptoparty.at/

Page 26: Was, SSH kann auch das?

Feedback

Pentabarf http://glt13-

programm.linuxtage.at/

Page 27: Was, SSH kann auch das?

Danksagungen

Smylers für “SSH Can Do That? Productivity Tips for Working with Remote Servers”

maclemon für Umfangreichen Input zu diesem Talk


Recommended