SlideShare a Scribd company logo
1 of 72
Download to read offline
Enhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and Security
Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto
LinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon Europe
October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015
Match User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluie
Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto
• Sysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.eu
• FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004
• DevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believer
• @roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie on irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/github
inuits.eu
World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/80497449@N04/10012162166
Connected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devices
• MMMMMMMMMMMMMMMMMainframes
• SSSSSSSSSSSSSSSSServers
• VVVVVVVVVVVVVVVVVirtual machines
• CCCCCCCCCCCCCCCCContainers
• IIIIIIIIIIIIIIIIIoT
Entrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance Doors
• PPPPPPPPPPPPPPPPPhysical Access
• TTTTTTTTTTTTTTTTTelnet
• RRRRRRRRRRRRRRRRRSH
• SSSSSSSSSSSSSSSSSSH
• HHHHHHHHHHHHHHHHHTTPS
• ……………………………………………
SSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSH
• DDDDDDDDDDDDDDDDDozens of implementations
• OOOOOOOOOOOOOOOOOpenSSH
• DDDDDDDDDDDDDDDDDropbear (embedded)
• CCCCCCCCCCCCCCCCClosed-source
• ……………………………………………
SSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSH
• DDDDDDDDDDDDDDDDDozens of usecases
• SSSSSSSSSSSSSSSSShell access and TCP Tunelling
• CCCCCCCCCCCCCCCCCode (git)
• FFFFFFFFFFFFFFFFFile transfert (sftp)
• XXXXXXXXXXXXXXXXX terminal (x2go)
• AAAAAAAAAAAAAAAAAutomation (ansible)
• ……………………………………………
OpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSH
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/pennuja/5399766800
OpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSH
• DDDDDDDDDDDDDDDDDeveloped by the OpenBSD project
• RRRRRRRRRRRRRRRRReleased first in 1995
• SSSSSSSSSSSSSSSSServer/Client implementation
• IIIIIIIIIIIIIIIIIncluded in BSD, Linux, Cygwin, Mac OS X, …
• AAAAAAAAAAAAAAAAAvailable in many other platforms
Out of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scope
• FFFFFFFFFFFFFFFFFirewalling, OS, …
• BBBBBBBBBBBBBBBBBasic tips: RootLogin, Pubkeys, …
• CCCCCCCCCCCCCCCCCrypto/Encryption/Key Exchanges
https://stribika.github.io/2015/01/04/secure-
secure-shell.html
SecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecurity
Licensed under a Creative Commons Asstribution-ShareAlike 2.0 License
https://www.flickr.com/photos/111692634@N04/11406986014
Common senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon sense
• DDDDDDDDDDDDDDDDDo you need SSH? (immutable infra,
containers…)
• KKKKKKKKKKKKKKKKKISS
• CCCCCCCCCCCCCCCCChose what will get public IP and then
exposition.. hypervisors vs vms?
• PPPPPPPPPPPPPPPPPort 22 is not Evil
Server-sideServer-sideServer-sideServer-sideServer-sideServer-sideServer-sideServer-sideServer-sideServer-sideServer-sideServer-sideServer-sideServer-sideServer-sideServer-sideServer-side
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/56001405@N06/6187271613
"Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config"
• /////////////////etc/ssh/sshd_config
• RRRRRRRRRRRRRRRRRestart of the service does not kill current
ssh sessions
Allow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rules
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/84388958@N03/7729300102
AllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsersAllowUsers
AllowUsers jenkins
AllowUsers jenkins nagios@172.31.29.5
AllowUsers jenkins nagios@172 .31.29.0/12
AllowUsers is exclusive
AllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroupsAllowGroups
AllowGroups staff jenkins
AllowGroups is exclusive
Allow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* ordering
• DDDDDDDDDDDDDDDDDenyUsers
• AAAAAAAAAAAAAAAAAllowUsers
• DDDDDDDDDDDDDDDDDenyGroups
• AAAAAAAAAAAAAAAAAllowGroups
MatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatch
• MMMMMMMMMMMMMMMMMatch + conditions
• rrrrrrrrrrrrrrrrreads until next Match or EOF
MatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatchMatch
AllowGroups staff
Match Address 172.31.16.8
AllowGroups staff jenkins
Trust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First Use
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/armandoh2o/7069748077
TOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFU
The authenticity of host 'example.com
(93.184.216.34)' can't be established.
ED25519 key fingerprint is SHA256:
eIvxpj9aMSS/+Ed7NQZ9er/
vyV17mabfiUxtgF2Q1X0.
Are you sure you want to continue
connecting (yes/no)?
Trust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first use
• WWWWWWWWWWWWWWWWWho checks the key on the server?
• WWWWWWWWWWWWWWWWWho says no?
• SSSSSSSSSSSSSSSSSecurity fatigue
Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)
• AAAAAAAAAAAAAAAAAutomation
• EEEEEEEEEEEEEEEEExport keys from hosts
• CCCCCCCCCCCCCCCCCollect them from hosts
• AAAAAAAAAAAAAAAAApply then to /etc/ssh/known_hosts
# saz/puppet−ssh − ASL 2.0
if $::sshrsakey {
@@sshkey { "${::fqdn}_rsa":
ensure => present,
host_aliases => $host_aliases,
type => rsa,
key => $::sshrsakey,
}
} else {
@@sshkey { "${::fqdn}_rsa":
ensure => absent,
}
}
Sshkey <<| |>>
Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)
• DDDDDDDDDDDDDDDDDNS
• EEEEEEEEEEEEEEEEExport keys in SSHFP DNS records
• CCCCCCCCCCCCCCCCCan be secured by DNSSEC
• hhhhhhhhhhhhhhhhhttps://github.com/jpmens/facts2sshfp
$ dig +short SSHFP example.com
1 1 F00A55CEA3B8E15528665A6781CA7C35190CF0
2 1 CC1F004DA60CF38E809FE58B10D0F22680D59D
ssh −o VerifyHostKeyDNS=yes example.com
The authenticity of host 'example.com
(93.184.216.34)' can't be established.
ED25519 key fingerprint is SHA256:
eIvxpj9aMSS/+Ed7NQZ9er/
vyV17mabfiUxtgF2Q1X0.
Matching host key fingerprint found in DNS
Are you sure you want to continue
connecting (yes/no)?
Authorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keys
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/brenda-starr/4498078166
ssh−rsa AAsafgrewgBzhfadgthgfpoDtGlUBIYhzf user@desktop
• OOOOOOOOOOOOOOOOOne key, one user
• AAAAAAAAAAAAAAAAAlways with a password
• DDDDDDDDDDDDDDDDDistribute them in an automated way
from="172.21.32.4" ssh−rsa AAspoDtGlUBIYhzf ansible
no−port−forwarding ,no−x11−forwarding ,no−agent−forwarding
ssh−rsa AAspDjeFJwFRf jenkins
ssh_authorized_key {
'jenkins ':
type => 'ssh−rsa',
key => 'AAAAKZ6TwZl3ikhY42clyY/De7J ',
user => 'jenkins ',
}
ssh_authorized_key {
'jenkins ':
type => 'ssh−rsa',
key => 'AAAAKZ6TwZl3ikhY42clyY/De7J ',
user => 'jenkins ',
options => 'from="192.168.10.1"'
}
Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!
user {
'jenkins ':
purge_ssh_keys => true ,
}
AuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommandAuthorizedKeysCommand
• SSSSSSSSSSSSSSSSScript that takes username as arguments
and returns authorized_keys
• EEEEEEEEEEEEEEEEExemple reference: openssh-ldap RPM
Client SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient Side
Licensed under a Creative Commons Zero License
@roidelapluie
Client configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configuration
• $$$$$$$$$$$$$$$$$HOME/.ssh/config
• /////////////////etc/ssh/ssh_config
Host web1
Hostname web1.example.com
User roidelapluie
SSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH Hops
Licensed under a Creative Commons Attribution-ShareAlike 2.0 License
https://www.flickr.com/photos/sarahrosenau/269786597
Host web1
Proxycommand ssh proxy nc %h %p
Host proxy
Proxycommand ssh out nc %h %p
SSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH Hops
• AAAAAAAAAAAAAAAAAcces restricted areas
• KKKKKKKKKKKKKKKKKeeps your private keys in your machine
• NNNNNNNNNNNNNNNNNo need for agent forwarding
SocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSockets
Licensed under a Creative Commons Attribution-ShareAlike 2.0 License
https://www.flickr.com/photos/restlessglobetrotter/2661016046
Host git.example.com
ControlMaster auto
ControlPath /tmp/ssh−%r@%h:%p
ControlPersist 5
SSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH Sockets
• SSSSSSSSSSSSSSSSSpeed up reconnection time
• DDDDDDDDDDDDDDDDDo not renegotiate each time
• UUUUUUUUUUUUUUUUUseful for git
Stopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSH
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/horiavarlan/4747872021
Send to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to background
<enter > ~ &
PausePausePausePausePausePausePausePausePausePausePausePausePausePausePausePausePause
<enter > ~ <ctrl+z>
Kill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the session
<enter > ~ .
TunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnels
Licensed under a Creative Commons Attribution-ShareAlike 2.0 License
https://www.flickr.com/photos/hanuska/5174842932
TunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnels
• TTTTTTTTTTTTTTTTTCP Tunnels
• SSSSSSSSSSSSSSSSSOCKS proxy
TunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnels
• LLLLLLLLLLLLLLLLLocal TCP Port Forwarding: give remote
acces to local port
• RRRRRRRRRRRRRRRRRemote TCP Port Forwarding: get access to
remote ports
Local TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port Forwarding
Icons from http://www.opensecurityarchitecture.org/cms/library/icon-library
and the Tango Icons project
Local TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port Forwarding
Icons from http://www.opensecurityarchitecture.org/cms/library/icon-library
and the Tango Icons project
Local TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port Forwarding
Icons from http://www.opensecurityarchitecture.org/cms/library/icon-library
and the Tango Icons project
Local TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel example
• UUUUUUUUUUUUUUUUUser A is natted behind a firewall
• HHHHHHHHHHHHHHHHHe wants to give User B access to local SSH
daemon
userA@hostA > ssh −NR 22222:localhost:22 userA@hostB
userB@hostB > ssh −p 22222 localhost
-N is for No Shell
Remote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port Forwarding
Icons from http://www.opensecurityarchitecture.org/cms/library/icon-library
and the Tango Icons project
Remote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port Forwarding
Icons from http://www.opensecurityarchitecture.org/cms/library/icon-library
and the Tango Icons project
Remote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding example
• UUUUUUUUUUUUUUUUUser A is behind a firewall that blocks VNC
port
• HHHHHHHHHHHHHHHHHe wants to access User B local VNC
daemon
userA@hostA > ssh −NL 5900:localhost:5900 userA@hostB
userA@hostA > vncviewer localhost
SOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS Proxy
• """""""""""""""""Dynamic" port forwarding
• EEEEEEEEEEEEEEEEEnable UDP, TCP, …
• CCCCCCCCCCCCCCCCCreates a SOCKS5 proxy
userA@hostA > ssh −ND 9500 userA@hostB
userA@hostA > proxychains wget http://example.com
ToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsTools
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/86639298@N02/8559728371
ssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agent
• SSSSSSSSSSSSSSSSStores your private key in memory
• eeeeeeeeeeeeeeeeeval $(ssh-agent)
• ssssssssssssssssssh-add; ssh-add -t 1h foo.key
• ssssssssssssssssssh-add -x (lock)
• ssssssssssssssssssh-add -X (unlock)
• PPPPPPPPPPPPPPPPPart of OpenSSH
screenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreen
• KKKKKKKKKKKKKKKKKeep session accross ssh connection
• HHHHHHHHHHHHHHHHHave multiple shell `windows'
• RRRRRRRRRRRRRRRRRun long command and keep them running
• ssssssssssssssssscreen (launch new session)
• CCCCCCCCCCCCCCCCCtrl+a d (detach)
• ssssssssssssssssscreen -dx (detach and reattach)
• ssssssssssssssssssh host -t screen -dx
• AAAAAAAAAAAAAAAAAlternative: tmux
reptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyr
• AAAAAAAAAAAAAAAAAttach a long running process to the current
terminal
• IIIIIIIIIIIIIIIIIdea: launch a screen and rattach another
process inside
• UUUUUUUUUUUUUUUUUseful when you forgot to launch your
screen before
• rrrrrrrrrrrrrrrrreptyr -p PID
vimvimvimvimvimvimvimvimvimvimvimvimvimvimvimvimvim
• EEEEEEEEEEEEEEEEEdit files remotely with scp
• vvvvvvvvvvvvvvvvvim scp://web//etc/hosts
ConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusion
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/freddyfromutah/4424199420
ConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusion
• SSSSSSSSSSSSSSSSSSH is still part of modern infrastructures
• IIIIIIIIIIIIIIIIIt should be part of what you
automate/control
• LLLLLLLLLLLLLLLLLots of other projects rely on it
• YYYYYYYYYYYYYYYYYou can harden it in a lot of ways
• TTTTTTTTTTTTTTTTThere is a lot of things to discover!
HomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomework
• SSSSSSSSSSSSSSSSSSH certificate authority
• cccccccccccccccccommand= permitopen=
• MMMMMMMMMMMMMMMMMatch blocks
• sssssssssssssssssshfs
• ……………………………………………
Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?
ContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContact
Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto
julien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eu
@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie
inuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuits
https://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.eu
info@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.eu
+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636

More Related Content

What's hot

Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Julien Pivotto
 
Diving Into Puppet Providers Development: The Puppet-Corosync Module
Diving Into Puppet Providers Development: The Puppet-Corosync ModuleDiving Into Puppet Providers Development: The Puppet-Corosync Module
Diving Into Puppet Providers Development: The Puppet-Corosync ModuleJulien Pivotto
 
Deployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone applicationDeployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone applicationJulien Pivotto
 
Testing your puppet code
Testing your puppet codeTesting your puppet code
Testing your puppet codeJulien Pivotto
 
Making Py Pi Sux Less Key
Making Py Pi Sux Less KeyMaking Py Pi Sux Less Key
Making Py Pi Sux Less KeyAndreas Jung
 
Continous Delivery of your Infrastructure
Continous Delivery of your InfrastructureContinous Delivery of your Infrastructure
Continous Delivery of your InfrastructureKris Buytaert
 
The Future of System Administration
The Future of System AdministrationThe Future of System Administration
The Future of System AdministrationKris Buytaert
 
11 Tools for your Open Source devops stack
11 Tools for your Open Source devops stack 11 Tools for your Open Source devops stack
11 Tools for your Open Source devops stack Kris Buytaert
 
Apache Rave (Incubating) at SURFnet
Apache Rave (Incubating) at SURFnetApache Rave (Incubating) at SURFnet
Apache Rave (Incubating) at SURFnetJasha Joachimsthal
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modulesKris Buytaert
 
Life Cycle of Metrics, Alerting, and Performance Monitoring in Microservices
Life Cycle of Metrics, Alerting, and Performance Monitoring in MicroservicesLife Cycle of Metrics, Alerting, and Performance Monitoring in Microservices
Life Cycle of Metrics, Alerting, and Performance Monitoring in MicroservicesSean Chittenden
 
Closing the gap between Distros(devs) and their Users(ops)
Closing the gap between Distros(devs) and their Users(ops)Closing the gap between Distros(devs) and their Users(ops)
Closing the gap between Distros(devs) and their Users(ops)Kris Buytaert
 
Open Source Monitoring in 2015
Open Source Monitoring in 2015Open Source Monitoring in 2015
Open Source Monitoring in 2015Kris Buytaert
 
On the Importance of Infrastructure as Code
On the Importance of Infrastructure as CodeOn the Importance of Infrastructure as Code
On the Importance of Infrastructure as CodeKris Buytaert
 
ContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven InfrastructureContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven InfrastructureYury Tsarev
 
Automating MySQL operations with Puppet
Automating MySQL operations with PuppetAutomating MySQL operations with Puppet
Automating MySQL operations with PuppetKris Buytaert
 
From MonitoringSucks to Monitoring Love , 2016 Edition
From MonitoringSucks to Monitoring Love , 2016 EditionFrom MonitoringSucks to Monitoring Love , 2016 Edition
From MonitoringSucks to Monitoring Love , 2016 EditionKris Buytaert
 
7 tools for your devops stack
7 tools for your devops stack7 tools for your devops stack
7 tools for your devops stackKris Buytaert
 
Devops is a Security Requirement
Devops is a Security RequirementDevops is a Security Requirement
Devops is a Security RequirementKris Buytaert
 

What's hot (20)

Coworking with git
Coworking with gitCoworking with git
Coworking with git
 
Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012
 
Diving Into Puppet Providers Development: The Puppet-Corosync Module
Diving Into Puppet Providers Development: The Puppet-Corosync ModuleDiving Into Puppet Providers Development: The Puppet-Corosync Module
Diving Into Puppet Providers Development: The Puppet-Corosync Module
 
Deployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone applicationDeployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone application
 
Testing your puppet code
Testing your puppet codeTesting your puppet code
Testing your puppet code
 
Making Py Pi Sux Less Key
Making Py Pi Sux Less KeyMaking Py Pi Sux Less Key
Making Py Pi Sux Less Key
 
Continous Delivery of your Infrastructure
Continous Delivery of your InfrastructureContinous Delivery of your Infrastructure
Continous Delivery of your Infrastructure
 
The Future of System Administration
The Future of System AdministrationThe Future of System Administration
The Future of System Administration
 
11 Tools for your Open Source devops stack
11 Tools for your Open Source devops stack 11 Tools for your Open Source devops stack
11 Tools for your Open Source devops stack
 
Apache Rave (Incubating) at SURFnet
Apache Rave (Incubating) at SURFnetApache Rave (Incubating) at SURFnet
Apache Rave (Incubating) at SURFnet
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 
Life Cycle of Metrics, Alerting, and Performance Monitoring in Microservices
Life Cycle of Metrics, Alerting, and Performance Monitoring in MicroservicesLife Cycle of Metrics, Alerting, and Performance Monitoring in Microservices
Life Cycle of Metrics, Alerting, and Performance Monitoring in Microservices
 
Closing the gap between Distros(devs) and their Users(ops)
Closing the gap between Distros(devs) and their Users(ops)Closing the gap between Distros(devs) and their Users(ops)
Closing the gap between Distros(devs) and their Users(ops)
 
Open Source Monitoring in 2015
Open Source Monitoring in 2015Open Source Monitoring in 2015
Open Source Monitoring in 2015
 
On the Importance of Infrastructure as Code
On the Importance of Infrastructure as CodeOn the Importance of Infrastructure as Code
On the Importance of Infrastructure as Code
 
ContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven InfrastructureContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven Infrastructure
 
Automating MySQL operations with Puppet
Automating MySQL operations with PuppetAutomating MySQL operations with Puppet
Automating MySQL operations with Puppet
 
From MonitoringSucks to Monitoring Love , 2016 Edition
From MonitoringSucks to Monitoring Love , 2016 EditionFrom MonitoringSucks to Monitoring Love , 2016 Edition
From MonitoringSucks to Monitoring Love , 2016 Edition
 
7 tools for your devops stack
7 tools for your devops stack7 tools for your devops stack
7 tools for your devops stack
 
Devops is a Security Requirement
Devops is a Security RequirementDevops is a Security Requirement
Devops is a Security Requirement
 

Similar to Enhance OpenSSH for fun and security

CentOS Config Management SIG
CentOS Config Management SIGCentOS Config Management SIG
CentOS Config Management SIGJulien Pivotto
 
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...NETWAYS
 
Managing a R&D Lab with Foreman
Managing a R&D Lab with ForemanManaging a R&D Lab with Foreman
Managing a R&D Lab with ForemanJulien Pivotto
 
Managing a R&D Lab with Foreman
Managing a R&D Lab with ForemanManaging a R&D Lab with Foreman
Managing a R&D Lab with ForemanJulien Pivotto
 
Dev secops opsec, devsec, devops ?
Dev secops opsec, devsec, devops ?Dev secops opsec, devsec, devops ?
Dev secops opsec, devsec, devops ?Kris Buytaert
 
An introduction to the Pulp project
An introduction to the Pulp projectAn introduction to the Pulp project
An introduction to the Pulp projectJulien Pivotto
 
Run stuff, Deploy Stuff, Jax London 2017 Edition
Run stuff, Deploy Stuff, Jax London 2017 EditionRun stuff, Deploy Stuff, Jax London 2017 Edition
Run stuff, Deploy Stuff, Jax London 2017 EditionKris Buytaert
 
Using Liferay Portal with LDAP and Single sign-on
Using Liferay Portal with LDAP and Single sign-onUsing Liferay Portal with LDAP and Single sign-on
Using Liferay Portal with LDAP and Single sign-onFirelay
 
Demystifying the Foreman
Demystifying the ForemanDemystifying the Foreman
Demystifying the ForemanJulien Pivotto
 
Another 7 tools for your #devops stack
Another 7 tools for your #devops stackAnother 7 tools for your #devops stack
Another 7 tools for your #devops stackKris Buytaert
 
OSDC 2016 - Another 7 Tools for your #devops Stack by Kris Buytaert
OSDC 2016 - Another 7 Tools for your #devops Stack by Kris BuytaertOSDC 2016 - Another 7 Tools for your #devops Stack by Kris Buytaert
OSDC 2016 - Another 7 Tools for your #devops Stack by Kris BuytaertNETWAYS
 
From Config Management Sucks to #cfgmgmtlove
From Config Management Sucks to #cfgmgmtlove From Config Management Sucks to #cfgmgmtlove
From Config Management Sucks to #cfgmgmtlove Kris Buytaert
 
Nightmare on Docker street
Nightmare on Docker streetNightmare on Docker street
Nightmare on Docker streetKris Buytaert
 
Town Hall - Business Implications of Open Source OSGi Implementations - BJ Ha...
Town Hall - Business Implications of Open Source OSGi Implementations - BJ Ha...Town Hall - Business Implications of Open Source OSGi Implementations - BJ Ha...
Town Hall - Business Implications of Open Source OSGi Implementations - BJ Ha...mfrancis
 
"The Sorry State of SSL" Hynek Schlawack, PyConRu 2014
"The Sorry State of SSL" Hynek Schlawack, PyConRu 2014"The Sorry State of SSL" Hynek Schlawack, PyConRu 2014
"The Sorry State of SSL" Hynek Schlawack, PyConRu 2014it-people
 

Similar to Enhance OpenSSH for fun and security (20)

CentOS Config Management SIG
CentOS Config Management SIGCentOS Config Management SIG
CentOS Config Management SIG
 
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...
 
Devops -- LKFR14
Devops -- LKFR14Devops -- LKFR14
Devops -- LKFR14
 
Managing a R&D Lab with Foreman
Managing a R&D Lab with ForemanManaging a R&D Lab with Foreman
Managing a R&D Lab with Foreman
 
Managing a R&D Lab with Foreman
Managing a R&D Lab with ForemanManaging a R&D Lab with Foreman
Managing a R&D Lab with Foreman
 
Dev secops opsec, devsec, devops ?
Dev secops opsec, devsec, devops ?Dev secops opsec, devsec, devops ?
Dev secops opsec, devsec, devops ?
 
DNSSec
DNSSecDNSSec
DNSSec
 
Pinto+Stratopan+Love
Pinto+Stratopan+LovePinto+Stratopan+Love
Pinto+Stratopan+Love
 
An introduction to the Pulp project
An introduction to the Pulp projectAn introduction to the Pulp project
An introduction to the Pulp project
 
Dive into Puppet 4
Dive into Puppet 4Dive into Puppet 4
Dive into Puppet 4
 
Run stuff, Deploy Stuff, Jax London 2017 Edition
Run stuff, Deploy Stuff, Jax London 2017 EditionRun stuff, Deploy Stuff, Jax London 2017 Edition
Run stuff, Deploy Stuff, Jax London 2017 Edition
 
Using Liferay Portal with LDAP and Single sign-on
Using Liferay Portal with LDAP and Single sign-onUsing Liferay Portal with LDAP and Single sign-on
Using Liferay Portal with LDAP and Single sign-on
 
DevOps, beyond agile
DevOps, beyond agileDevOps, beyond agile
DevOps, beyond agile
 
Demystifying the Foreman
Demystifying the ForemanDemystifying the Foreman
Demystifying the Foreman
 
Another 7 tools for your #devops stack
Another 7 tools for your #devops stackAnother 7 tools for your #devops stack
Another 7 tools for your #devops stack
 
OSDC 2016 - Another 7 Tools for your #devops Stack by Kris Buytaert
OSDC 2016 - Another 7 Tools for your #devops Stack by Kris BuytaertOSDC 2016 - Another 7 Tools for your #devops Stack by Kris Buytaert
OSDC 2016 - Another 7 Tools for your #devops Stack by Kris Buytaert
 
From Config Management Sucks to #cfgmgmtlove
From Config Management Sucks to #cfgmgmtlove From Config Management Sucks to #cfgmgmtlove
From Config Management Sucks to #cfgmgmtlove
 
Nightmare on Docker street
Nightmare on Docker streetNightmare on Docker street
Nightmare on Docker street
 
Town Hall - Business Implications of Open Source OSGi Implementations - BJ Ha...
Town Hall - Business Implications of Open Source OSGi Implementations - BJ Ha...Town Hall - Business Implications of Open Source OSGi Implementations - BJ Ha...
Town Hall - Business Implications of Open Source OSGi Implementations - BJ Ha...
 
"The Sorry State of SSL" Hynek Schlawack, PyConRu 2014
"The Sorry State of SSL" Hynek Schlawack, PyConRu 2014"The Sorry State of SSL" Hynek Schlawack, PyConRu 2014
"The Sorry State of SSL" Hynek Schlawack, PyConRu 2014
 

More from Julien Pivotto

What's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its EcosystemWhat's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its EcosystemJulien Pivotto
 
Prometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingJulien Pivotto
 
What's new in Prometheus?
What's new in Prometheus?What's new in Prometheus?
What's new in Prometheus?Julien Pivotto
 
Introduction to Grafana Loki
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana LokiJulien Pivotto
 
Why you should revisit mgmt
Why you should revisit mgmtWhy you should revisit mgmt
Why you should revisit mgmtJulien Pivotto
 
Observing the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From PrometheusObserving the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From PrometheusJulien Pivotto
 
Monitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with PrometheusMonitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with PrometheusJulien Pivotto
 
5 tips for Prometheus Service Discovery
5 tips for Prometheus Service Discovery5 tips for Prometheus Service Discovery
5 tips for Prometheus Service DiscoveryJulien Pivotto
 
Prometheus and TLS - an Introduction
Prometheus and TLS - an IntroductionPrometheus and TLS - an Introduction
Prometheus and TLS - an IntroductionJulien Pivotto
 
Powerful graphs in Grafana
Powerful graphs in GrafanaPowerful graphs in Grafana
Powerful graphs in GrafanaJulien Pivotto
 
HAProxy as Egress Controller
HAProxy as Egress ControllerHAProxy as Egress Controller
HAProxy as Egress ControllerJulien Pivotto
 
Improved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and AlertmanagerImproved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and AlertmanagerJulien Pivotto
 
SIngle Sign On with Keycloak
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with KeycloakJulien Pivotto
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaborationJulien Pivotto
 
Incident Resolution as Code
Incident Resolution as CodeIncident Resolution as Code
Incident Resolution as CodeJulien Pivotto
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusJulien Pivotto
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusJulien Pivotto
 
An introduction to Ansible
An introduction to AnsibleAn introduction to Ansible
An introduction to AnsibleJulien Pivotto
 

More from Julien Pivotto (20)

The O11y Toolkit
The O11y ToolkitThe O11y Toolkit
The O11y Toolkit
 
What's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its EcosystemWhat's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its Ecosystem
 
Prometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is coming
 
What's new in Prometheus?
What's new in Prometheus?What's new in Prometheus?
What's new in Prometheus?
 
Introduction to Grafana Loki
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana Loki
 
Why you should revisit mgmt
Why you should revisit mgmtWhy you should revisit mgmt
Why you should revisit mgmt
 
Observing the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From PrometheusObserving the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From Prometheus
 
Monitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with PrometheusMonitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with Prometheus
 
5 tips for Prometheus Service Discovery
5 tips for Prometheus Service Discovery5 tips for Prometheus Service Discovery
5 tips for Prometheus Service Discovery
 
Prometheus and TLS - an Introduction
Prometheus and TLS - an IntroductionPrometheus and TLS - an Introduction
Prometheus and TLS - an Introduction
 
Powerful graphs in Grafana
Powerful graphs in GrafanaPowerful graphs in Grafana
Powerful graphs in Grafana
 
YAML Magic
YAML MagicYAML Magic
YAML Magic
 
HAProxy as Egress Controller
HAProxy as Egress ControllerHAProxy as Egress Controller
HAProxy as Egress Controller
 
Improved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and AlertmanagerImproved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and Alertmanager
 
SIngle Sign On with Keycloak
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with Keycloak
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaboration
 
Incident Resolution as Code
Incident Resolution as CodeIncident Resolution as Code
Incident Resolution as Code
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with Prometheus
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with Prometheus
 
An introduction to Ansible
An introduction to AnsibleAn introduction to Ansible
An introduction to Ansible
 

Recently uploaded

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 

Recently uploaded (20)

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 

Enhance OpenSSH for fun and security

  • 1. Enhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and SecurityEnhance OpenSSH for Fun and Security Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto LinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon EuropeLinuxCon Europe October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015October 5, 2015
  • 2. Match User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluieMatch User roidelapluie Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto • Sysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.eu • FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004 • DevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believer • @roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie on irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/github
  • 4. World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015World, 2015 Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/80497449@N04/10012162166
  • 5. Connected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devicesConnected devices • MMMMMMMMMMMMMMMMMainframes • SSSSSSSSSSSSSSSSServers • VVVVVVVVVVVVVVVVVirtual machines • CCCCCCCCCCCCCCCCContainers • IIIIIIIIIIIIIIIIIoT
  • 6. Entrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance DoorsEntrance Doors • PPPPPPPPPPPPPPPPPhysical Access • TTTTTTTTTTTTTTTTTelnet • RRRRRRRRRRRRRRRRRSH • SSSSSSSSSSSSSSSSSSH • HHHHHHHHHHHHHHHHHTTPS • ……………………………………………
  • 7. SSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSH • DDDDDDDDDDDDDDDDDozens of implementations • OOOOOOOOOOOOOOOOOpenSSH • DDDDDDDDDDDDDDDDDropbear (embedded) • CCCCCCCCCCCCCCCCClosed-source • ……………………………………………
  • 8. SSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSHSSH • DDDDDDDDDDDDDDDDDozens of usecases • SSSSSSSSSSSSSSSSShell access and TCP Tunelling • CCCCCCCCCCCCCCCCCode (git) • FFFFFFFFFFFFFFFFFile transfert (sftp) • XXXXXXXXXXXXXXXXX terminal (x2go) • AAAAAAAAAAAAAAAAAutomation (ansible) • ……………………………………………
  • 9. OpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSH Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/pennuja/5399766800
  • 10. OpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSHOpenSSH • DDDDDDDDDDDDDDDDDeveloped by the OpenBSD project • RRRRRRRRRRRRRRRRReleased first in 1995 • SSSSSSSSSSSSSSSSServer/Client implementation • IIIIIIIIIIIIIIIIIncluded in BSD, Linux, Cygwin, Mac OS X, … • AAAAAAAAAAAAAAAAAvailable in many other platforms
  • 11. Out of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scopeOut of scope • FFFFFFFFFFFFFFFFFirewalling, OS, … • BBBBBBBBBBBBBBBBBasic tips: RootLogin, Pubkeys, … • CCCCCCCCCCCCCCCCCrypto/Encryption/Key Exchanges https://stribika.github.io/2015/01/04/secure- secure-shell.html
  • 12. SecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecuritySecurity Licensed under a Creative Commons Asstribution-ShareAlike 2.0 License https://www.flickr.com/photos/111692634@N04/11406986014
  • 13. Common senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon senseCommon sense • DDDDDDDDDDDDDDDDDo you need SSH? (immutable infra, containers…) • KKKKKKKKKKKKKKKKKISS • CCCCCCCCCCCCCCCCChose what will get public IP and then exposition.. hypervisors vs vms? • PPPPPPPPPPPPPPPPPort 22 is not Evil
  • 15. "Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config""Server config" • /////////////////etc/ssh/sshd_config • RRRRRRRRRRRRRRRRRestart of the service does not kill current ssh sessions
  • 16. Allow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rulesAllow/Deny rules Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/84388958@N03/7729300102
  • 19. Allow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* orderingAllow* ordering • DDDDDDDDDDDDDDDDDenyUsers • AAAAAAAAAAAAAAAAAllowUsers • DDDDDDDDDDDDDDDDDenyGroups • AAAAAAAAAAAAAAAAAllowGroups
  • 22. Trust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First UseTrust On First Use Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/armandoh2o/7069748077
  • 23. TOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFUTOFU The authenticity of host 'example.com (93.184.216.34)' can't be established. ED25519 key fingerprint is SHA256: eIvxpj9aMSS/+Ed7NQZ9er/ vyV17mabfiUxtgF2Q1X0. Are you sure you want to continue connecting (yes/no)?
  • 24. Trust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first useTrust on first use • WWWWWWWWWWWWWWWWWho checks the key on the server? • WWWWWWWWWWWWWWWWWho says no? • SSSSSSSSSSSSSSSSSecurity fatigue
  • 25. Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2)Alternative to TOFU (1/2) • AAAAAAAAAAAAAAAAAutomation • EEEEEEEEEEEEEEEEExport keys from hosts • CCCCCCCCCCCCCCCCCollect them from hosts • AAAAAAAAAAAAAAAAApply then to /etc/ssh/known_hosts
  • 26. # saz/puppet−ssh − ASL 2.0 if $::sshrsakey { @@sshkey { "${::fqdn}_rsa": ensure => present, host_aliases => $host_aliases, type => rsa, key => $::sshrsakey, } } else { @@sshkey { "${::fqdn}_rsa": ensure => absent, } }
  • 28. Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2)Alternative to TOFU (2/2) • DDDDDDDDDDDDDDDDDNS • EEEEEEEEEEEEEEEEExport keys in SSHFP DNS records • CCCCCCCCCCCCCCCCCan be secured by DNSSEC • hhhhhhhhhhhhhhhhhttps://github.com/jpmens/facts2sshfp
  • 29. $ dig +short SSHFP example.com 1 1 F00A55CEA3B8E15528665A6781CA7C35190CF0 2 1 CC1F004DA60CF38E809FE58B10D0F22680D59D
  • 31. The authenticity of host 'example.com (93.184.216.34)' can't be established. ED25519 key fingerprint is SHA256: eIvxpj9aMSS/+Ed7NQZ9er/ vyV17mabfiUxtgF2Q1X0. Matching host key fingerprint found in DNS Are you sure you want to continue connecting (yes/no)?
  • 32. Authorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keysAuthorized keys Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/brenda-starr/4498078166
  • 33. ssh−rsa AAsafgrewgBzhfadgthgfpoDtGlUBIYhzf user@desktop • OOOOOOOOOOOOOOOOOne key, one user • AAAAAAAAAAAAAAAAAlways with a password • DDDDDDDDDDDDDDDDDistribute them in an automated way
  • 34. from="172.21.32.4" ssh−rsa AAspoDtGlUBIYhzf ansible no−port−forwarding ,no−x11−forwarding ,no−agent−forwarding ssh−rsa AAspDjeFJwFRf jenkins
  • 35. ssh_authorized_key { 'jenkins ': type => 'ssh−rsa', key => 'AAAAKZ6TwZl3ikhY42clyY/De7J ', user => 'jenkins ', }
  • 36. ssh_authorized_key { 'jenkins ': type => 'ssh−rsa', key => 'AAAAKZ6TwZl3ikhY42clyY/De7J ', user => 'jenkins ', options => 'from="192.168.10.1"' }
  • 37. Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys!Purge undefined keys! user { 'jenkins ': purge_ssh_keys => true , }
  • 39. Client SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient SideClient Side Licensed under a Creative Commons Zero License @roidelapluie
  • 40. Client configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configurationClient configuration • $$$$$$$$$$$$$$$$$HOME/.ssh/config • /////////////////etc/ssh/ssh_config
  • 42. SSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH Hops Licensed under a Creative Commons Attribution-ShareAlike 2.0 License https://www.flickr.com/photos/sarahrosenau/269786597
  • 43. Host web1 Proxycommand ssh proxy nc %h %p Host proxy Proxycommand ssh out nc %h %p
  • 44. SSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH HopsSSH Hops • AAAAAAAAAAAAAAAAAcces restricted areas • KKKKKKKKKKKKKKKKKeeps your private keys in your machine • NNNNNNNNNNNNNNNNNo need for agent forwarding
  • 45. SocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSocketsSockets Licensed under a Creative Commons Attribution-ShareAlike 2.0 License https://www.flickr.com/photos/restlessglobetrotter/2661016046
  • 46. Host git.example.com ControlMaster auto ControlPath /tmp/ssh−%r@%h:%p ControlPersist 5
  • 47. SSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH SocketsSSH Sockets • SSSSSSSSSSSSSSSSSpeed up reconnection time • DDDDDDDDDDDDDDDDDo not renegotiate each time • UUUUUUUUUUUUUUUUUseful for git
  • 48. Stopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSHStopping OpenSSH Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/horiavarlan/4747872021
  • 49. Send to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to backgroundSend to background <enter > ~ &
  • 51. Kill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the sessionKill the session <enter > ~ .
  • 52. TunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnels Licensed under a Creative Commons Attribution-ShareAlike 2.0 License https://www.flickr.com/photos/hanuska/5174842932
  • 54. TunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnelsTunnels • LLLLLLLLLLLLLLLLLocal TCP Port Forwarding: give remote acces to local port • RRRRRRRRRRRRRRRRRemote TCP Port Forwarding: get access to remote ports
  • 55. Local TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port Forwarding Icons from http://www.opensecurityarchitecture.org/cms/library/icon-library and the Tango Icons project
  • 56. Local TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port Forwarding Icons from http://www.opensecurityarchitecture.org/cms/library/icon-library and the Tango Icons project
  • 57. Local TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port ForwardingLocal TCP Port Forwarding Icons from http://www.opensecurityarchitecture.org/cms/library/icon-library and the Tango Icons project
  • 58. Local TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel exampleLocal TCP Tunnel example • UUUUUUUUUUUUUUUUUser A is natted behind a firewall • HHHHHHHHHHHHHHHHHe wants to give User B access to local SSH daemon userA@hostA > ssh −NR 22222:localhost:22 userA@hostB userB@hostB > ssh −p 22222 localhost -N is for No Shell
  • 59. Remote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port Forwarding Icons from http://www.opensecurityarchitecture.org/cms/library/icon-library and the Tango Icons project
  • 60. Remote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port ForwardingRemote TCP Port Forwarding Icons from http://www.opensecurityarchitecture.org/cms/library/icon-library and the Tango Icons project
  • 61. Remote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding exampleRemote Port Forwarding example • UUUUUUUUUUUUUUUUUser A is behind a firewall that blocks VNC port • HHHHHHHHHHHHHHHHHe wants to access User B local VNC daemon userA@hostA > ssh −NL 5900:localhost:5900 userA@hostB userA@hostA > vncviewer localhost
  • 62. SOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS ProxySOCKS Proxy • """""""""""""""""Dynamic" port forwarding • EEEEEEEEEEEEEEEEEnable UDP, TCP, … • CCCCCCCCCCCCCCCCCreates a SOCKS5 proxy userA@hostA > ssh −ND 9500 userA@hostB userA@hostA > proxychains wget http://example.com
  • 63. ToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsToolsTools Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/86639298@N02/8559728371
  • 64. ssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agentssh-agent • SSSSSSSSSSSSSSSSStores your private key in memory • eeeeeeeeeeeeeeeeeval $(ssh-agent) • ssssssssssssssssssh-add; ssh-add -t 1h foo.key • ssssssssssssssssssh-add -x (lock) • ssssssssssssssssssh-add -X (unlock) • PPPPPPPPPPPPPPPPPart of OpenSSH
  • 65. screenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreenscreen • KKKKKKKKKKKKKKKKKeep session accross ssh connection • HHHHHHHHHHHHHHHHHave multiple shell `windows' • RRRRRRRRRRRRRRRRRun long command and keep them running • ssssssssssssssssscreen (launch new session) • CCCCCCCCCCCCCCCCCtrl+a d (detach) • ssssssssssssssssscreen -dx (detach and reattach) • ssssssssssssssssssh host -t screen -dx • AAAAAAAAAAAAAAAAAlternative: tmux
  • 66. reptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyrreptyr • AAAAAAAAAAAAAAAAAttach a long running process to the current terminal • IIIIIIIIIIIIIIIIIdea: launch a screen and rattach another process inside • UUUUUUUUUUUUUUUUUseful when you forgot to launch your screen before • rrrrrrrrrrrrrrrrreptyr -p PID
  • 67. vimvimvimvimvimvimvimvimvimvimvimvimvimvimvimvimvim • EEEEEEEEEEEEEEEEEdit files remotely with scp • vvvvvvvvvvvvvvvvvim scp://web//etc/hosts
  • 69. ConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusion • SSSSSSSSSSSSSSSSSSH is still part of modern infrastructures • IIIIIIIIIIIIIIIIIt should be part of what you automate/control • LLLLLLLLLLLLLLLLLots of other projects rely on it • YYYYYYYYYYYYYYYYYou can harden it in a lot of ways • TTTTTTTTTTTTTTTTThere is a lot of things to discover!
  • 70. HomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomework • SSSSSSSSSSSSSSSSSSH certificate authority • cccccccccccccccccommand= permitopen= • MMMMMMMMMMMMMMMMMatch blocks • sssssssssssssssssshfs • ……………………………………………
  • 71. Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?
  • 72. ContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContact Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto julien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eu @roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie inuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuits https://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.eu info@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.eu +32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636