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

  FORUM HardWare.fr
  Programmation
  Shell/Batch

  [Shell] Port forwarding / saisie du mot de passe automatique

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[Shell] Port forwarding / saisie du mot de passe automatique

n°2199226
Sethenssen
Posté le 01-08-2013 à 22:14:19  profilanswer
 

Bonjour,
 
Je fais du port forwarding avec la commande suivante:

Code :
  1. ssh -N -f -L6000:172.12.23.6:22 user@localhost -p7000


Il me demande le mot de pass, je le rentre et tout se passe bien dans le meilleur des mondes.
 
Mon besoin est simple,
Je veux exécuter dans un script cette ligne et entrer automatiquement le password.
 
Comment puis-je faire?
 
Il n'est pas possible pour moi de passer par des clés ssh.
 
Merci.


Message édité par Sethenssen le 01-08-2013 à 22:42:20
mood
Publicité
Posté le 01-08-2013 à 22:14:19  profilanswer
 

n°2199236
roondar
Posté le 01-08-2013 à 23:08:52  profilanswer
 
n°2199242
Sethenssen
Posté le 02-08-2013 à 08:23:54  profilanswer
 

Merci roondar,
Excusez mais je suis novice.
 
Comment puis-je installer ce package et avez-vous un exemple de ligne de commande que je puisse tester?
 
Merci.

n°2199249
roondar
Posté le 02-08-2013 à 13:16:34  profilanswer
 

Si c'est sur une debian/ubuntu :
 apt-get install sshpass

n°2199294
Je@nb
Kindly give dime
Posté le 02-08-2013 à 20:30:57  profilanswer
 

le mieux étant qd même de faire une authent via clé privée/clé publique :)

n°2199296
Sethenssen
Posté le 02-08-2013 à 20:33:19  profilanswer
 

Oui, mais hélas je ne peux pas  
 
Je n'arrive pas à installer le package. Je ne suis pas sous debian mais sous l'émulateur cygwin.
 

Code :
  1. $ ./configure
  2. checking for a BSD-compatible install... /usr/bin/install -c
  3. checking whether build environment is sane... yes
  4. checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
  5. checking for gawk... gawk
  6. checking whether make sets $(MAKE)... yes
  7. checking for style of include used by make... GNU
  8. checking for gcc... gcc
  9. checking whether the C compiler works... yes
  10. checking for C compiler default output file name... a.exe
  11. checking for suffix of executables... .exe
  12. checking whether we are cross compiling... no
  13. checking for suffix of object files... o
  14. checking whether we are using the GNU C compiler... yes
  15. checking whether gcc accepts -g... yes
  16. checking for gcc option to accept ISO C89... none needed
  17. checking dependency style of gcc... gcc3
  18. checking how to run the C preprocessor... gcc -E
  19. checking for grep that handles long lines and -e... /usr/bin/grep
  20. checking for egrep... /usr/bin/grep -E
  21. checking for ANSI C header files... yes
  22. checking for sys/types.h... yes
  23. checking for sys/stat.h... yes
  24. checking for stdlib.h... yes
  25. checking for string.h... yes
  26. checking for memory.h... yes
  27. checking for strings.h... yes
  28. checking for inttypes.h... yes
  29. checking for stdint.h... yes
  30. checking for unistd.h... yes
  31. checking minix/config.h usability... no
  32. checking minix/config.h presence... no
  33. checking for minix/config.h... no
  34. checking whether it is safe to define __EXTENSIONS__... yes
  35. checking for gcc... (cached) gcc
  36. checking whether we are using the GNU C compiler... (cached) yes
  37. checking whether gcc accepts -g... (cached) yes
  38. checking for gcc option to accept ISO C89... (cached) none needed
  39. checking dependency style of gcc... (cached) gcc3
  40. checking for ANSI C header files... (cached) yes
  41. checking for sys/wait.h that is POSIX.1 compatible... yes
  42. checking fcntl.h usability... yes
  43. checking fcntl.h presence... yes
  44. checking for fcntl.h... yes
  45. checking for stdlib.h... (cached) yes
  46. checking for string.h... (cached) yes
  47. checking sys/ioctl.h usability... yes
  48. checking sys/ioctl.h presence... yes
  49. checking for sys/ioctl.h... yes
  50. checking for unistd.h... (cached) yes
  51. checking termios.h usability... yes
  52. checking termios.h presence... yes
  53. checking for termios.h... yes
  54. checking for an ANSI C-conforming const... yes
  55. checking for pid_t... yes
  56. checking for ssize_t... yes
  57. checking vfork.h usability... no
  58. checking vfork.h presence... no
  59. checking for vfork.h... no
  60. checking for fork... yes
  61. checking for vfork... yes
  62. checking for working fork... yes
  63. checking for working vfork... (cached) yes
  64. checking whether gcc needs -traditional... no
  65. checking for stdlib.h... (cached) yes
  66. checking for GNU libc compatible malloc... yes
  67. checking sys/select.h usability... yes
  68. checking sys/select.h presence... yes
  69. checking for sys/select.h... yes
  70. checking sys/socket.h usability... yes
  71. checking sys/socket.h presence... yes
  72. checking for sys/socket.h... yes
  73. checking types of arguments for select... int,fd_set *,struct timeval *
  74. checking return type of signal handlers... void
  75. checking for select... yes
  76. checking for posix_openpt... yes
  77. checking for strdup... yes
  78. configure: creating ./config.status
  79. config.status: creating Makefile
  80. config.status: creating config.h
  81. config.status: config.h is unchanged
  82. config.status: executing depfiles commands


Message édité par Sethenssen le 02-08-2013 à 20:33:39
n°2199365
roondar
Posté le 04-08-2013 à 15:11:18  profilanswer
 

Ca devrait fonctionner.


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Shell/Batch

  [Shell] Port forwarding / saisie du mot de passe automatique

 

Sujets relatifs
Ajout automatique d'une ligne sur excel avec couleurLancement automatique d'une macro - tous les jours, sans intervention
[VBA] mise à jour automatique d'une cellule[Batch] Copier des fichiers ayant le meme nom en gardant la structure
[BATCH] choix des caractères[Batch] Création d'utilisateurs
génération automatique d'un emploie du temps_windevAjout de ligne automatique sur excel 2010 - VBA
Envoie automatique de mails via outlook en VBABatch Mise a jour BDD Mysql
Plus de sujets relatifs à : [Shell] Port forwarding / saisie du mot de passe automatique


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