Ma config : le serveur est une Ubuntu 8.10 qui tourne sur virtualbox, via un nat et du port forwarding.
je peux me logguer sur mon serveur en tapant mon mot de passe depuis un putty sur mon client windows, tout fonctionne.
J'ai voulu mettre en place l'authentification par clé, mais ça ne fonctionne pas.
Voici ce que j'ai fait :
- J'ai généré une paire de clé via ssh-keygen -t dsa
- j'ai fait un cat id_dsa.pub >> .ssh/authorized_keys2
- j'ai vérifié les droits : seul le user a les droits en écriture :
Code :
- jubijub@Jubiserver:~/.ssh$ ls -lh
- total 16K
- -rw-r--r-- 1 jubijub jubijub 608 2008-12-08 00:38 authorized_keys
- -rw-r--r-- 1 jubijub jubijub 608 2008-12-08 00:16 authorized_keys2
- -rw------- 1 jubijub jubijub 736 2008-12-08 00:15 id_dsa
- -rw-r--r-- 1 jubijub jubijub 608 2008-12-08 00:15 id_dsa.pub
|
- j'ai relancé mon server ssh
- j'ai copié la clé privée dans un fichier private.ppk qui est sur mon client windows
- je lance putty en indiquant ma clé privée via SSH/auth, et j'ai l'erreur suivante :
Unable to use key file "E:\CD\Applications\VirtualBox\private.ppk" (OpenSSH SSH-2 private key)
si je cat le authorized_keys2
Code :
- jubijub@Jubiserver:~/.ssh$ cat authorized_keys2
- ssh-dss AAAAB3NzaC1kc3MAAACBAOcl2rSnGSY9yNKjoZeFPKC60wUxDYQt5FsB6/tF5CEHpbnIwHvSXIBARwamaF9+Qh9ViW4cqE+mgJdLHlo6Pj2U+NpnHHPHMrDZnZ0ngfSG6KJh1yLdzclxysPbHQ4YpHS0yflb5bTgCrWAAsHHRO9uGYNVOZrRlQQ3P9hPGFABAAAAFQCUzNLZbylh/buCZuq3B2bhznxZawAAAIEblablablablaM+TNu2Os2QjSkB2/yvZptPLCr5TVNNpuF7S9FSZuLLSeuckc8RciVpC3oRRPoL4th07/yadCff60pHLjb3aYDItE6jzScgR6FDpxEf5qtASxEhkTffK0tqbEfH8rS43X6d/etA+9gYYtHnlfDei9bdQUR5c5qlaIAAACAaUZh4stZaJPkQHhyYkkgUL7AkMqDrmLbHZiqsrCgJ3NiJrA3zTLlLDsM2syc2WB4XgQRWP+FfX+eVfWESBT5RpZmB5ZJdL6JjE/axZVxa39gu8a/ZAmC9vmv3yawtC4XObQFD0b0IELY9A6zOv5yEQdr7ef3xJr0Wp76B59vD9s= jubijub@Jubiserver
|
Mon sshd.config
Code :
- jubijub@Jubiserver:~/.ssh$ sudo cat /etc/ssh/sshd_config
- [sudo] password for jubijub:
- # Package generated configuration file
- # See the sshd(8) manpage for details
- # What ports, IPs and protocols we listen for
- Port 22
- # Use these options to restrict which interfaces/protocols sshd will bind to
- #ListenAddress ::
- #ListenAddress 0.0.0.0
- Protocol 2
- # HostKeys for protocol version 2
- HostKey /etc/ssh/ssh_host_rsa_key
- HostKey /etc/ssh/ssh_host_dsa_key
- #Privilege Separation is turned on for security
- UsePrivilegeSeparation yes
- # Lifetime and size of ephemeral version 1 server key
- KeyRegenerationInterval 3600
- ServerKeyBits 768
- # Logging
- SyslogFacility AUTH
- LogLevel INFO
- # Authentication:
- LoginGraceTime 120
- PermitRootLogin yes
- StrictModes yes
- RSAAuthentication yes
- PubkeyAuthentication yes
- AuthorizedKeysFile %h/.ssh/authorized_keys2
- # Don't read the user's ~/.rhosts and ~/.shosts files
- IgnoreRhosts yes
- # For this to work you will also need host keys in /etc/ssh_known_hosts
- RhostsRSAAuthentication no
- # similar for protocol version 2
- HostbasedAuthentication no
- # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
- #IgnoreUserKnownHosts yes
- # To enable empty passwords, change to yes (NOT RECOMMENDED)
- PermitEmptyPasswords no
- # Change to yes to enable challenge-response passwords (beware issues with
- # some PAM modules and threads)
- ChallengeResponseAuthentication no
- # Change to no to disable tunnelled clear text passwords
- #PasswordAuthentication yes
- # 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
- # Allow client to pass locale environment variables
- AcceptEnv LANG LC_*
- Subsystem sftp /usr/lib/openssh/sftp-server
- UsePAM yes
|
je dois rater qqc, mais je vois pas quoi
Message édité par Jubijub le 08-12-2008 à 00:58:55
---------------
Jubi Photos : Flickr - 500px