Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1401 connectés 

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Ssh + nom de machine

n°423042
full_phil
Posté le 03-03-2004 à 21:08:43  profilanswer
 

Voilà alors je suis sous Mandrake 9.2. Je voudrais pouvoir accéder à ma machine depuis d'autres machines reliées à internet.  
 
J'y arrive de cette manière : je lance la commande ifconfig sur ma machine (le serveur), je récupère mon adresse inet, et de l'autre machine (le client) je me connecte par ssh, et ça marche.
 
Par contre je voudrais m'y connecter en utilisant un nom fixe, contrairement à l'adresse ip). J'ai défini un nom de machine (bidon) à ma machine sous la forme machine.domainebidon.fr,  mais en essayent le ssh, j'ai l'erreur suivante : ssh_exchange_identification: Connection closed by remote host
En utilisant le mode verbose, j'ai vu que l'adresse ip qu'il essaie de rallier est incorrecte. ca m'aurait étonné que ca marche en effet, mais je ne sais pas trop comment faire... merci

mood
Publicité
Posté le 03-03-2004 à 21:08:43  profilanswer
 

n°423055
alien cons​piracy
hardtrance addict
Posté le 03-03-2004 à 21:55:02  profilanswer
 

/etc/hosts

n°423067
full_phil
Posté le 03-03-2004 à 22:11:44  profilanswer
 

tu pourrais etre un peu plus precis stp ?


Message édité par full_phil le 03-03-2004 à 22:15:08
n°423069
GUG
Posté le 03-03-2004 à 22:14:57  profilanswer
 


il veut dire : tu remplie /etc/hosts avec les nom/ip des machines. Pour plus d'info man hosts.
 
Tu peux aussi mettre un DNS pour ton reseau local ;) :D

n°423073
full_phil
Posté le 03-03-2004 à 22:17:12  profilanswer
 

GUG a écrit :


il veut dire : tu remplie /etc/hosts avec les nom/ip des machines. Pour plus d'info man hosts.
Tu peux aussi mettre un DNS pour ton reseau local ;) :D

oui, mais ca sert à rien vu que l'ip change a chaque connexion... alors je me connecte avec le numero d'ip c pareil
Comment on met se un DNS sinon ?? c payant ??

n°423078
Profil sup​primé
Posté le 03-03-2004 à 22:22:33  answer
 

full_phil a écrit :

oui, mais ca sert à rien vu que l'ip change a chaque connexion... alors je me connecte avec le numero d'ip c pareil
Comment on met se un DNS sinon ?? c payant ??


 
il parle de l' ip de ton poste ds ton lan.
si tu veux pouvoir acceder de l' exterieur fo un nom de domaine ou faire des bidouilles de nerdz, ds ce cas attends un nerdz plus doué que moi pour te répondre.

n°423081
full_phil
Posté le 03-03-2004 à 22:25:36  profilanswer
 

ok... mais elle y est l'ip, j'en ai 2, celle pour le localhost, et celle dans le reseau

n°423099
o'gure
Modérateur
Multi grognon de B_L
Posté le 03-03-2004 à 22:39:41  profilanswer
 

le nom de machine bidon que tu as mis a ton serveur ssh il serait pas deja utilise sur le net par hazard ??

n°423106
o'gure
Modérateur
Multi grognon de B_L
Posté le 03-03-2004 à 22:43:28  profilanswer
 

le truc le plus simple c est que tu vas chez dyndns.org ou autre hebergeur dns gratuit
tu te crees un compte chez lui (creation d un nom de machine)
C est dyndns qui va s occuper de fournir l adresse IP a ce qui la demande
toi la seule chose a faire c est de mettre ajour cette adresse dans leur base (notament via un ptit script qui la met a jour quand l @IP change)
 
voilou

n°423116
Faxone
Posté le 03-03-2004 à 22:54:40  profilanswer
 

1) tu t'ouvres un compte dns dynamic sur le site www.dyndns.org que tu nommes par exemple "lecomptedephil"
2) tu te crées un hostname par exemple "lamachinedephil.dyndns.org"
3) tu installes sur la machine serveur (la machine sur laquelle tu veux te connecter) un client dyndns (par exemple ipcheck)
4) tu configures le client avec les paramètres qui vont bien
5) tu mets en cron le client
6) tu peux ensuite te connecter depuis internet sur ta machine serveur en tapant : ssh lamachinedephil.dyndns.org
 
Voila c'est la méthode que j'utilise.

mood
Publicité
Posté le 03-03-2004 à 22:54:40  profilanswer
 

n°423121
full_phil
Posté le 03-03-2004 à 22:58:42  profilanswer
 

O'gure a écrit :

le nom de machine bidon que tu as mis a ton serveur ssh il serait pas deja utilise sur le net par hazard ??
 

oui, en fait c ca, j'ai changé pour un nom qui ne risquait pas d'exister et la c le ssh: *****.totoblablaboubou.fr: Name or service not known

n°423122
full_phil
Posté le 03-03-2004 à 22:59:09  profilanswer
 

ok je v voir ca merci bien

n°423124
o'gure
Modérateur
Multi grognon de B_L
Posté le 03-03-2004 à 23:01:19  profilanswer
 

mais comment veux tu que ton client puisse obtenir l adresse IP de ton serveur via ton nom bidon si il n est dans aucun serveur DNS ???

n°423137
full_phil
Posté le 03-03-2004 à 23:08:48  profilanswer
 

O'gure a écrit :

mais comment veux tu que ton client puisse obtenir l adresse IP de ton serveur via ton nom bidon si il n est dans aucun serveur DNS ???

c ca que je disais dans mon premier message, que je me doutais que ca marcherait pas...  ;)


Message édité par full_phil le 03-03-2004 à 23:09:11
n°423152
full_phil
Posté le 03-03-2004 à 23:30:21  profilanswer
 

eheh merci à vous ca marche parfaitement...

n°423203
full_phil
Posté le 04-03-2004 à 02:37:17  profilanswer
 

J'ai quand meme un probleme, c'est qu'avec cette methode, si je ne vide pas le dossier $HOME/.ssh (ou tout du moins l'entree qui correspond), il ne veut pas me connecter car il s'apercoit que l'ip a changé (normal, nouvelle connexion avec l'adsl) pour le meme nom

Code :
  1. Password authentication is disabled to avoid man-in-the-middle attacks.
  2. X11 forwarding is disabled to avoid man-in-the-middle attacks.
  3. Permission denied (publickey,password,keyboard-interactive).


 
ssh + dynamic dns ne fonctionnerait pas ?
 
Une méthode pour résoudre ce problème ?


Message édité par full_phil le 04-03-2004 à 02:46:02
n°423252
void_ppc
Posté le 04-03-2004 à 09:43:59  profilanswer
 

full_phil a écrit :

J'ai quand meme un probleme, c'est qu'avec cette methode, si je ne vide pas le dossier $HOME/.ssh (ou tout du moins l'entree qui correspond), il ne veut pas me connecter car il s'apercoit que l'ip a changé (normal, nouvelle connexion avec l'adsl) pour le meme nom

Code :
  1. Password authentication is disabled to avoid man-in-the-middle attacks.
  2. X11 forwarding is disabled to avoid man-in-the-middle attacks.
  3. Permission denied (publickey,password,keyboard-interactive).


 
ssh + dynamic dns ne fonctionnerait pas ?
 
Une méthode pour résoudre ce problème ?


 
fait voir la config de ton sshd, ca doit etre /etc/sshd/sshd_config ou un truc du genre

n°423409
full_phil
Posté le 04-03-2004 à 12:17:01  profilanswer
 

Code :
  1. # $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $
  2. # This is the sshd server system-wide configuration file.  See
  3. # sshd_config(5) for more information.
  4. # This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
  5. # The strategy used for options in the default sshd_config shipped with
  6. # OpenSSH is to specify options with their default value where
  7. # possible, but leave them commented.  Uncommented options change a
  8. # default value.
  9. #Port 22
  10. Protocol 2,1
  11. #ListenAddress 0.0.0.0
  12. #ListenAddress ::
  13. # HostKey for protocol version 1
  14. HostKey /etc/ssh/ssh_host_key
  15. # HostKeys for protocol version 2
  16. HostKey /etc/ssh/ssh_host_rsa_key
  17. HostKey /etc/ssh/ssh_host_dsa_key
  18. # Lifetime and size of ephemeral version 1 server key
  19. #KeyRegenerationInterval 3600
  20. #ServerKeyBits 768
  21. # Logging
  22. #obsoletes QuietMode and FascistLogging
  23. #SyslogFacility AUTH
  24. #LogLevel INFO
  25. # Authentication:
  26. #LoginGraceTime 120
  27. PermitRootLogin yes
  28. #StrictModes yes
  29. #RSAAuthentication yes
  30. #PubkeyAuthentication yes
  31. #AuthorizedKeysFile .ssh/authorized_keys
  32. # rhosts authentication should not be used
  33. #RhostsAuthentication no
  34. # Don't read the user's ~/.rhosts and ~/.shosts files
  35. #IgnoreRhosts yes
  36. # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
  37. #RhostsRSAAuthentication no
  38. # similar for protocol version 2
  39. #HostbasedAuthentication no
  40. # Change to yes if you don't trust ~/.ssh/known_hosts for
  41. # RhostsRSAAuthentication and HostbasedAuthentication
  42. #IgnoreUserKnownHosts no
  43. # To disable tunneled clear text passwords, change to no here!
  44. #PasswordAuthentication yes
  45. #PermitEmptyPasswords no
  46. # Change to no to disable s/key passwords
  47. #ChallengeResponseAuthentication yes
  48. # Kerberos options
  49. #KerberosAuthentication no
  50. #KerberosOrLocalPasswd yes
  51. #KerberosTicketCleanup yes
  52. #AFSTokenPassing no
  53. # Kerberos TGT Passing only works with the AFS kaserver
  54. #KerberosTgtPassing no
  55. # Set this to 'yes' to enable PAM keyboard-interactive authentication
  56. # Warning: enabling this may bypass the setting of 'PasswordAuthentication'
  57. #PAMAuthenticationViaKbdInt no
  58. X11Forwarding yes
  59. #X11DisplayOffset 10
  60. #X11UseLocalhost yes
  61. #PrintMotd yes
  62. #PrintLastLog yes
  63. #KeepAlive yes
  64. #UseLogin no
  65. UsePrivilegeSeparation yes
  66. #PermitUserEnvironment no
  67. #Compression yes
  68. #MaxStartups 10
  69. # no default banner path
  70. #Banner /some/path
  71. #VerifyReverseMapping no
  72. # override default of no subsystems
  73. Subsystem sftp /usr/lib/ssh/sftp-server

n°423413
bobuse
Posté le 04-03-2004 à 12:21:24  profilanswer
 

Au passage, comment on fait pour restreindre l'authentification à celle par clé privée pour les accès WAN (non LAN) ?

n°423865
Faxone
Posté le 04-03-2004 à 18:15:28  profilanswer
 

Voici mon fichier de config. Je me connecte ainsi à mon serveur qui se trouve sur mon lan qui est relié à internet par un routeur adsl avec ip dynamique
 

Code :
  1. #       $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $
  2. # This is the sshd server system-wide configuration file.  See
  3. # sshd_config(5) for more information.
  4. # This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
  5. # The strategy used for options in the default sshd_config shipped with
  6. # OpenSSH is to specify options with their default value where
  7. # possible, but leave them commented.  Uncommented options change a
  8. # default value.
  9. #Port 22
  10. Protocol 2,1
  11. #ListenAddress 0.0.0.0
  12. #ListenAddress ::
  13. # HostKey for protocol version 1
  14. HostKey /etc/ssh/ssh_host_key
  15. # HostKeys for protocol version 2
  16. HostKey /etc/ssh/ssh_host_rsa_key
  17. HostKey /etc/ssh/ssh_host_dsa_key
  18. # Lifetime and size of ephemeral version 1 server key
  19. #KeyRegenerationInterval 3600
  20. #ServerKeyBits 768
  21. # Logging
  22. #obsoletes QuietMode and FascistLogging
  23. #SyslogFacility AUTH
  24. #LogLevel INFO
  25. # Authentication:
  26. #LoginGraceTime 120
  27. PermitRootLogin no
  28. #StrictModes yes
  29. #RSAAuthentication yes
  30. #PubkeyAuthentication yes
  31. #AuthorizedKeysFile     .ssh/authorized_keys
  32. # rhosts authentication should not be used
  33. #RhostsAuthentication no
  34. # Don't read the user's ~/.rhosts and ~/.shosts files
  35. #IgnoreRhosts yes
  36. # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
  37. #RhostsRSAAuthentication no
  38. # similar for protocol version 2
  39. #HostbasedAuthentication no
  40. # Change to yes if you don't trust ~/.ssh/known_hosts for
  41. # RhostsRSAAuthentication and HostbasedAuthentication
  42. #IgnoreUserKnownHosts no
  43. # To disable tunneled clear text passwords, change to no here!
  44. #PasswordAuthentication yes
  45. #PermitEmptyPasswords no
  46. # Change to no to disable s/key passwords
  47. #ChallengeResponseAuthentication yes
  48. # Kerberos options
  49. #KerberosAuthentication no
  50. #KerberosOrLocalPasswd yes
  51. #KerberosTicketCleanup yes
  52. #AFSTokenPassing no
  53. # Kerberos TGT Passing only works with the AFS kaserver
  54. #KerberosTgtPassing no
  55. # Set this to 'yes' to enable PAM keyboard-interactive authentication
  56. # Warning: enabling this may bypass the setting of 'PasswordAuthentication'
  57. #PAMAuthenticationViaKbdInt no
  58. X11Forwarding yes
  59. #X11DisplayOffset 10
  60. #X11UseLocalhost yes
  61. #PrintMotd yes
  62. #PrintLastLog yes
  63. #KeepAlive yes
  64. #UseLogin no
  65. UsePrivilegeSeparation yes
  66. #PermitUserEnvironment no
  67. #Compression yes
  68. #MaxStartups 10
  69. # no default banner path
  70. #Banner /some/path
  71. #VerifyReverseMapping no
  72. # override default of no subsystems
  73. Subsystem       sftp    /usr/lib/ssh/sftp-server


 
Mais je ne comprends pas trop, tu parles du $home/.ssh sur l'ordi qui lance l'accès au serveur ssh ?
Si oui, c'est plutot du coté de la config client qu'il faut voir. Pour info, je n'ai utilisé mon accès ssh qu'à travers le programme putty pour windows. Essaie pour voir.

n°423914
full_phil
Posté le 04-03-2004 à 18:55:18  profilanswer
 

Faxone a écrit :

Mais je ne comprends pas trop, tu parles du $home/.ssh sur l'ordi qui lance l'accès au serveur ssh ?
Si oui, c'est plutot du coté de la config client qu'il faut voir. Pour info, je n'ai utilisé mon accès ssh qu'à travers le programme putty pour windows. Essaie pour voir.

J'essaierai ce soir quand j'aurais le temps, mais le pb vient du côté client à mon avis... c'est lui qui refuse de me voir me connecter à une même machine qui change d'ip

Code :
  1. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  2. @       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
  3. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  4. The RSA host key for ******.dyndns.org has changed,
  5. and the key for the according IP address ******
  6. is unknown. This could either mean that
  7. DNS SPOOFING is happening or the IP address for the host
  8. and its host key have changed at the same time.
  9. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  10. @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
  11. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  12. IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
  13. Someone could be eavesdropping on you right now (man-in-the-middle attack)!
  14. It is also possible that the RSA host key has just been changed.
  15. The fingerprint for the RSA key sent by the remote host is
  16. ef:0f:e2:.....
  17. Please contact your system administrator.
  18. Add correct host key in /home/fullphil/.ssh/known_hosts to get rid of this message.
  19. Offending key in /home/fullphil/.ssh/known_hosts:6
  20. Password authentication is disabled to avoid man-in-the-middle attacks.
  21. X11 forwarding is disabled to avoid man-in-the-middle attacks.
  22. Permission denied (publickey,password,keyboard-interactive).


Message édité par full_phil le 04-03-2004 à 18:56:16
n°423929
full_phil
Posté le 04-03-2004 à 19:22:37  profilanswer
 

@Faxone : a premiere vue on a le meme à part rootlogin....

n°424005
tamiel32
Posté le 04-03-2004 à 20:32:52  profilanswer
 

tu vides /home/user/.ssh/known_hosts du user avec lequelle tu vas te connecter via ssh.
 
Apres tu t'inscris sur dyndns.org pour avoir un nom de domaine sur une ip dynamique.
Ensuite tu installes ez-ipupdate pour que le daeomon se lance au demarrage et actualise ton ip dynamique avec ton nom de domaine dyndns.
 
apres tu pourras te connecter via ssh :  ssh user@domain.dyndns
 
ça marche très bien :)
 
(fin de message nerdzien)

n°424050
Faxone
Posté le 04-03-2004 à 21:24:52  profilanswer
 

full_phil : je pense vraiment que ca doit etre une protection de ton client ssh.

n°424053
full_phil
Posté le 04-03-2004 à 21:26:40  profilanswer
 

ca a l'air de bien marcher maintenant... ma fois je crois ne rien avoir touché en plus ;)

mood
Publicité
Posté le   profilanswer
 


Aller à :
Ajouter une réponse
 

Sujets relatifs
Ma machine non visible dans linneighborhood / voisinage reseauMDK 9.2 .... nommer sa machine.
connecter une machine linux a un reseau gerer par wingate en NAT ?Explorer une machine Samba dans le voisinage reseau
Faire en sorte qu'un prog lancé en SSH continue de tourner ?administrer sa machine a distance via ssh
connaitre le nom d'une machine windows a partir d'un linuxmachine virtuelle java et mandrake9.1...
[RH7.3] Se connecter en SSH à sa machine : connexion refused ?[ SSH ] Une interface graphique pour controler une machine distante ?
Plus de sujets relatifs à : Ssh + nom de machine


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR