Bonsoir,
Je reviens vers vous car j’ai un problème concernant le port 22 de ma Bbox pour l’utilisation d’un petit serveur maison avec ssh.
Actuellement j’ai 2 ordis, un serveur sous Debian avec openssh-server d’installé et un ordi sous Crunchbang avec openssh-client d’installé;
pour une connexion en local aucun problème, de Crunchbang à Debian :
ssh root@192.168.1.6 -----> fonctionne parfaitement.
j’ai donc essayé une connexion extérieure de mon portable Crunchbang vers Debian en utilisant bien sur mon IP public :
ssh root@89.X.X.X ------> un message d’erreur du type : “port 22: No route to host”
bon ok, donc je chine à droite à gauche et j’apprends qu’il faut ouvrir le port 22 dans sa box/routeur.
je vais donc dans ma Bbox (bouygues télécom), puis dans configuration du routeur et enfin NAT/PAT et je rentre ceci :
“nom de la règle” = serveur
"protocole" = TCP
"Choix Port/plage de ports" = port
"Port(s) source(s)" = 22
"@ IP de destination ou nom de l’ordinateur" = 192.168.1.6 (l’IP local du serveur Debian donc)
“Port de destination” = 22
et enfin j’ai coché la case “Toujours attribuer cette règle à cet ordinateur”.
j’enregistre puis sur mon portable Crunchbang (client), je fais un nmap 192.168.1.6 qui m’affiche :
Interesting ports on new-host-4.home (192.168.1.6):
Not shown: 998 closed ports
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
mais quand je fais un nmap 89.X.X.X (IP public de ma box redirigé par le port 22 sur mon serveur Debian) ca m’affiche :
Interesting ports on FAST3504 (89.X.X.X):
Not shown: 994 closed ports
PORT STATE SERVICE
80/tcp open http
443/tcp open https
2222/tcp open unknown
8080/tcp open http-proxy
8443/tcp open https-alt
8888/tcp open sun-answerbook
comme je n’ai pas la possibilité de tester en “extérieur” comme bon me semble une connexion ssh, avant ma prochaine tentative pouvez-vous me dire si je suis sur la bonne route ou si le fais que la ligne :
“22/tcp open ssh” n’apparaisse pas dans le nmap de mon IP public soit un problème ?
voici le contenu de sshd_config :
[code]# 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_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[/code]
merci d’avance pour vos suggestions et votre aide.