Ne pas cliquer
Parrain-Linux
ne mange pas les petits chats
Écrire un nouveau message
Page : 1
Je ne parviens pas à obtenir une connexion SSH
Avatar
obelix1502
utilisateur
Parrain
Inscrit le : 17/12/2014
Messages : 64
Point(s) : 3870
Distribution : Manjaro
Localisation :
Frameries, Hainaut, Belgique
Posté le 17/08/2016 à 23:19:16
Citer

Bonsoir,

Voilà deux jours que je bosse sur le même problème.

J'ai un serveur externe (dedibox) chez online. Et comme le dit le titre, je ne parviens pas à établir une connexion SSH pour administrer celle-ci.

J'ai fait plein de recherches, changé le mot de passe : en mode "rescue" je parviens à obtenir une connexion mais pas en mode normal.

J'ai suivi le tutoriel de ubuntu.fr : Tutoriel surtout la partie clé publique-clé privée, mais je ne comprends pas tout (à 50 piges, on ne se refait pas).

Jai comparé les deux fichiers
Code:

/etc/ssh/sshd_config

Et ils sont identiques :

Code:

obelix@ip:~$ cat /etc/ssh/sshd_config# Package generated configuration file
# See the sshd_config(5) 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
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# 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

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# 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

À chaque fois que j'essaie la connexion, j'obtiens ceci :

Code:

obelix1502@obelix1502-All-Series ~ $ ssh obelix@ip The authenticity of host 'ip (ip)' can't be established.
ECDSA key fingerprint is SHA256:.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/obelix1502/.ssh/known_hosts).
obelix@ip's password:
Permission denied, please try again.
obelix@ip's password:
Permission denied, please try again.
obelix@ip's password:
Permission denied (publickey,password).

Ou cela :

Code:

[sudo] Mot de passe de obelix1502 : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:1
remove with:
ssh-keygen -f "/root/.ssh/known_hosts" -R ip

Sincèrement, je ne sais plus quoi faire. Je ne peux administrer ma seedbox et je n'obtiens qu'une connexion en mode rescue où le système d'online me fournit un mot de passe.

J'ai déjà changé mon ancien mot de passe en mode rescue, mais rien n'y fait grrrrrrr




EDIT lagout : je me suis permis de masquer les ip et les fingerprint , pensse à le faire la prochaine fois :)

Dernière édition le 18/08/2016 à 12:55:09
_________________
http://www.parrain-linux.com/promotion.php?image=pl-banniere.png&membre=obelix1502

https://ticker.aiduce.org/obelix1502.png
Remonter Descendre Permalien du message
Avatar
obelix1502
utilisateur
Parrain
Inscrit le : 17/12/2014
Messages : 64
Point(s) : 3870
Distribution : Manjaro
Localisation :
Frameries, Hainaut, Belgique
Posté le 18/08/2016 à 00:36:22
Citer

Ne cherchez plus, j'ai trouvé.

En fait, lorsque j'ai changé d'ordi, j'ai formaté la /.

Donc mon /etc/ssh/sshd_config n'existait plus et ma clé privée non plus.

J'ai donc dû en recréer une et la transmettre au serveur par
Code:

ssh-copy-id -i ~/.ssh/id_rsa.pub <username>@<ipaddress>


_________________
http://www.parrain-linux.com/promotion.php?image=pl-banniere.png&membre=obelix1502

https://ticker.aiduce.org/obelix1502.png
Remonter Descendre Permalien du message
Avatar
H2L29
modérateur
Parrain
Inscrit le : 11/03/2015
Messages : 383
Point(s) : 10434
Distribution : Debian
Localisation :
Brest, Finistère, France
Posté le 18/08/2016 à 06:05:36
Citer

salut, pense à retirer les données sensible tel que les users, ip, et fingerprints

_________________
http://www.parrain-linux.com/promotion.php?image=PL-user.png&membre=H2L29
http://h2l29.pagesperso-orange.fr/images/GIF001.GIF
pas d'aide par MP utilisez le forum c'est fait pour ça http://www.parrain-linux.com/images/emoticones/kopete020.gif
Remonter Descendre Permalien du message
Avatar
Noxius
utilisateur
Parrain
Inscrit le : 14/05/2014
Messages : 247
Point(s) : 1415
Distribution : Debian 9 & Gnome 3
Localisation :
Ariège, France
Posté le 18/08/2016 à 06:48:39
Citer

Si c'est toujours la même adresse ip fait la commande

ssh-keygen -f "/root/.ssh/known_hosts" -R IP

Dernière édition le 18/08/2016 à 12:56:19
_________________
http://www.gnomelibre.fr/wp-content/uploads/2015/05/banner_debian_jessie.jpg
Remonter Descendre Permalien du message
Avatar
compte supprimé
utilisateur supprimé
supprimé
Inscrit le : inconnu
Messages : inconnu
Point(s) : 0
Distribution : Debian 9 & Gnome 3
Localisation :

Posté le 26/08/2016 à 17:43:16
Citer

brunotux => chez ip n'a pu démander administrateur par email ?
si tu veux m'a parler par skype si tu veux cet aujourd'hui vendredi au mardi :)

bon week end :)
Rodrigue

Remonter Descendre Permalien du message
Écrire un nouveau message
Page : 1
Page générée en 2.4276 seconde(s).