[SSH] Wel intern, niet extern?

Pagina: 1
Acties:

  • Milenco
  • Registratie: April 2000
  • Laatst online: 10-05 22:00
Ik heb net Debian geinstalleerd en ben begonnen met SSH in te stellen. Alles staat standaard ingesteld, maar ik kan niet van buitenaf connecten :(.
Het IP van de machine met Debian is 192.168.1.5. Intern kan ik deze machine perfect benaderen op poort 22. Maar nu komt het probleem.

Als ik vanaf buitenaf de machine wil benaderen op milenco.xs4all.nl, doet deze niet. Ik heb de router zo ingesteld dat die port 22 TCP naar 192.168.1.5 forwards. Aan de router ligt het ook niet, want http://milenco.xs4all.nl:80/ doet namelijk ook wel.

Is er een instelling die ik over het hoofd heb gezien?
Ik kom er niet uit :'(

  • |orion
  • Registratie: Juli 2002
  • Laatst online: 16-04 15:16
Heb je al gekeken of je de port wel correct hebt geforward?

  • Milenco
  • Registratie: April 2000
  • Laatst online: 10-05 22:00
|orion schreef op 06 February 2003 @ 23:18:
Heb je al gekeken of je de port wel correct hebt geforward?
Jep, ik heb port 22 TCP geforwards. Ik heb voor de zekerheid port 20 t/m 30 TCP en UDP gelijk er maar bij mee genomen

Verwijderd

Een scan wijst uit dat je poort 22 netjes dicht staat. Dus gaat er kennelijk iets niet goed met forwarden op je router.

Verwijderd

heb je in /etc/ssh/sshd_config al met ListenAddress gespeeld?

Verwijderd

firewall ? op doos

  • Milenco
  • Registratie: April 2000
  • Laatst online: 10-05 22:00
M'n sshd_config:
login as: root
root@m-server's password:
Last login: Thu Feb 6 22:57:30 2003 from milenco.wg on pts/0
Linux m-server 2.2.20-idepci #1 Sat Apr 20 12:45:19 EST 2002 i686 unknown

Most of the programs included with the Debian GNU/Linux system are
freely redistributable; the exact distribution terms for each program
are described in the individual files in /usr/share/doc/*/copyright

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Feb 6 22:57:30 2003 from milenco.wg
m-server:~# cd /etc/ssh/
m-server:/etc/ssh# cat sshd_config
# Package generated configuration file
# See the sshd(8) manpage for defails

# 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

# ...but breaks Pam auth via kbdint, so we have to turn it off
# Use PAM authentication via keyboard-interactive so PAM modules can
# properly interface with the user (off due to PrivSep)
PAMAuthenticationViaKbdInt no
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 600
PermitRootLogin yes
StrictModes yes

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

# rhosts authentication should not be used
RhostsAuthentication no
# 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

# Uncomment to disable s/key passwords
#ChallengeResponseAuthentication no

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes


# To change Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#AFSTokenPassing no
#KerberosTicketCleanup no

# Kerberos TGT Passing does only work with the AFS kaserver
#KerberosTgtPassing yes

X11Forwarding no
X11DisplayOffset 10
PrintMotd no
#PrintLastLog no
KeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net
#ReverseMappingCheck yes

Subsystem sftp /usr/lib/sftp-server
De firewall zou alleen maar in debian zelf kunnen zitten, maar het is een schone install, alles staat op standaard :?

  • JeroenE
  • Registratie: Januari 2001
  • Niet online
Milenco schreef op 07 February 2003 @ 08:00:
De firewall zou alleen maar in debian zelf kunnen zitten, maar het is een schone install, alles staat op standaard :?
Start sshd in debian standaard misschien via (x)inetd of TCP wrappers? In zo'n geval kan het natuurlijk zijn dat die geen ssh connectie van buiten toestaan. Kijk eens in hosts.allow en/of hosts.deny als dat het geval is.

  • Milenco
  • Registratie: April 2000
  • Laatst online: 10-05 22:00
jeroene schreef op 07 February 2003 @ 08:17:
[...]


Start sshd in debian standaard misschien via (x)inetd of TCP wrappers? In zo'n geval kan het natuurlijk zijn dat die geen ssh connectie van buiten toestaan. Kijk eens in hosts.allow en/of hosts.deny als dat het geval is.
hosts.allow:

code:
1
2
3
4
5
6
7
8
9
10
11
12
# /etc/hosts.allow: list of hosts that are allowed to access the system.
#                   See the manual pages hosts_access(5), hosts_options(5)
#                   and /usr/doc/netbase/portmapper.txt.gz
#
# Example:    ALL: LOCAL @some_netgroup
#             ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If you're going to protect the portmapper use the name "portmap" for the
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper. See portmap(8)
# and /usr/doc/portmap/portmapper.txt.gz for further information.
#


hosts.deny:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# /etc/hosts.deny: list of hosts that are _not_ allowed to access the system.
#                  See the manual pages hosts_access(5), hosts_options(5)
#                  and /usr/doc/netbase/portmapper.txt.gz
#
# Example:    ALL: some.host.name, .some.domain
#             ALL EXCEPT in.fingerd: other.host.name, .other.domain
#
# If you're going to protect the portmapper use the name "portmap" for the
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper. See portmap(8)
# and /usr/doc/portmap/portmapper.txt.gz for further information.
#
# The PARANOID wildcard matches any host whose name does not match its
# address. You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
# ALL: PARANOID

  • JeroenE
  • Registratie: Januari 2001
  • Niet online
Default policy is accept, dus daar ligt het niet aan. Je schreef dat je poort 20 t/m 30 forward, maar telnet (port 23) werkt ook niet. Zoals het er nu naar uitziet lijkt het toch aan de router te liggen.

Als je inlogt op je xs4all account kan je vanuit thuis kijken of je op je server kan komen en tegelijkertijd de logfile van je router bekijken om te zien of daar iets in te vinden is.

  • Milenco
  • Registratie: April 2000
  • Laatst online: 10-05 22:00
jeroene schreef op 07 February 2003 @ 09:11:
Default policy is accept, dus daar ligt het niet aan. Je schreef dat je poort 20 t/m 30 forward, maar telnet (port 23) werkt ook niet. Zoals het er nu naar uitziet lijkt het toch aan de router te liggen.

Als je inlogt op je xs4all account kan je vanuit thuis kijken of je op je server kan komen en tegelijkertijd de logfile van je router bekijken om te zien of daar iets in te vinden is.
telnet doet idd niet, want die heb ik geuninstalled.

Ik heb telnet nu ff geinstalled. Vage is dat ik daar met geen enkele account kan inloggen :?
Debian GNU/Linux 3.0 m-server.wg
m-server login: root
Password:
Login incorrect

m-server login:
Misschien kunnen jullie ff checken of telnet doet?

  • Milenco
  • Registratie: April 2000
  • Laatst online: 10-05 22:00
Mja het is gelukt. Blijkbaar kan m'n router het aan. Ik heb nu poort 100 van buitenaf geforwards naar port 22 naar 192.168.1.5 (server). Nu werkt het wel :)

Edit:
Ik gebruik de Draytek 2300

[ Voor 13% gewijzigd door Milenco op 07-02-2003 13:20 ]

Pagina: 1