Avatar billede spm Nybegynder
04. marts 2004 - 13:08 Der er 6 kommentarer og
1 løsning

Sshd adgang fra en computer der ikke er del af det lokale netværk

Hej.
nu ligger det sådan at jeg skal et halvt går til mellemamerika og derfor skal jeg stadig kunne få kontakt til min server hjemme i DK. Jeg bruger sshd men jeg kan ikke rigtigt finde ud af om det er muligt at få fat i den "udefra".  Jeg mener at jeg engang i tidernes  morgen satte et kryds i et felt der gjorde at det kun var muligt at logge på via ssh fra lokal net...
min sshd-config ser således ud:
#      $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.

#Port 22
#Protocol 2,1
#ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

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

# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 120
#PermitRootLogin yes
#StrictModes yes

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile    .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/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no

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

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

#AFSTokenPassing no

# Kerberos TGT Passing only works with the AFS kaserver
#KerberosTgtPassing no

# Set this to 'yes' to enable PAM keyboard-interactive authentication
# Warning: enabling this may bypass the setting of 'PasswordAuthentication'
#PAMAuthenticationViaKbdInt no

#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#KeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes

#MaxStartups 10
# no default banner path
#Banner /some/path
#VerifyReverseMapping no

# override default of no subsystems
Subsystem      sftp    /usr/libexec/openssh/sftp-server


har jeg adgang fra en ikke-lokal-computer??
Avatar billede spm Nybegynder
04. marts 2004 - 13:09 #1
ov. glemte lige at sige at jeg i min ip tables har åbent for port 22. jeg brugte den der onlige scan fra sygate...
Avatar billede skau Nybegynder
04. marts 2004 - 13:10 #2
check /etc/hosts.allow og /etc/hosts.deny
Avatar billede spm Nybegynder
04. marts 2004 - 13:17 #3
min hosts.allow:
#
# hosts.allow  This file describes the names of the hosts which are
#              allowed to use the local INET services, as decided
#              by the '/usr/sbin/tcpd' server.
#

service: 192.168.0.2/255.255.255.0, 192.168.0.3/255.255.255.0
portmap: 192.168.0.2, 192.168.0.3
lockd: 192.168.0.2, 192.168.0.3
rquotad: 192.168.0.2, 192.168.0.3
mounted: 192.168.0.2, 192.168.0.3
statd: 192.168.0.2, 192.168.0.3


min host.deny
# hosts.deny    This file describes the names of the hosts which are
#              *not* allowed to use the local INET services, as decided
#              by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow.  In particular
# you should know that NFS uses portmap!
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL


hvad skal jeg så smide der ind?
Avatar billede skau Nybegynder
04. marts 2004 - 13:22 #4
i hosts.allow:
sshd: All
Avatar billede Slettet bruger
04. marts 2004 - 13:52 #5
Hvis du giver mig et ip-nummer, kan jeg nemt teste, om den svarer på login-forsøg udefra. (Jeg skal ikke have brugernavn og password.)
Avatar billede spm Nybegynder
04. marts 2004 - 16:00 #6
jeg har fået en til at teste det.
men han få meddelsen: network error.

I min hosts.allow har jeg indsat    sshd: ALL    mystisk
Avatar billede thetoastmaster Juniormester
05. marts 2004 - 13:20 #7
du skal skrive All ikke ALL, og der SKAL være en tom linie til sidst, så når du har skreveet din linie så tryk enter før du saver....
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester