Académique Documents
Professionnel Documents
Culture Documents
------------------------------------------------------------------------------
--- installation & configurtion du serveur SSH
------------------------------------------------------------------------------
root@serveur:~# ls /etc/ssh/
moduli sshd_config ssh_host_dsa_key.pub ssh_host_rsa_key.pub
ssh_config ssh_host_dsa_key ssh_host_rsa_key
LPIC-2 / examen LPI 202 / SSH - Atelier - version 0.1 / Hedi MAGROUN 1/6
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
LPIC-2 / examen LPI 202 / SSH - Atelier - version 0.1 / Hedi MAGROUN 2/6
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
root@serveur:~#
LPIC-2 / examen LPI 202 / SSH - Atelier - version 0.1 / Hedi MAGROUN 3/6
------------------------------------------------------------------------------
--- utilisation du client SSH
------------------------------------------------------------------------------
hedi@client:~$ ls /etc/ssh/
moduli ssh_config
Host *
# ForwardAgent no
# ForwardX11 no
# ForwardX11Trusted yes
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# Port 22
# Protocol 2,1
# Cipher 3des
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-
cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
LPIC-2 / examen LPI 202 / SSH - Atelier - version 0.1 / Hedi MAGROUN 4/6
GSSAPIDelegateCredentials no
hedi@client:~$ ls .ssh/
known_hosts
LPIC-2 / examen LPI 202 / SSH - Atelier - version 0.1 / Hedi MAGROUN 5/6
hedi@client:~$ ssh-copy-id mehdi@192.168.56.101
mehdi@192.168.56.101's password: LeMotDEPasse
Now try logging into the machine, with "ssh 'mehdi@192.168.56.101'", and check
in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
Linux serveur 2.6.32-5-686 #1 SMP Sun Sep 23 09:49:36 UTC 2012 i686
...
mehdi@serveur:~$ file ~/.ssh/authorized_keys
/home/mehdi/.ssh/authorized_keys: ASCII text, with very long lines
mehdi@serveur:~$ exit
Connection to 192.168.56.101 closed.
hedi@client:~$
LPIC-2 / examen LPI 202 / SSH - Atelier - version 0.1 / Hedi MAGROUN 6/6