 |  | | | | | | | | |  |  | | | | | Fortgeschrittener Benutzer
Status: Offline Beiträge: 102 Registriert seit: 01.09.2004 Ort: Zürich Alter: 23 | SSH standard port aendern -
21.03.2006, 17:05
salut
ich habe versucht auf Linux Fedora Core 4 den port von ssh (standard 22) mittels der datei /etc/ssh/sshd_conf abzuaendern. Nach dem restart des sshd daemon (/etc/init.d/sshd restart) habe ich jedoch keinen ssh Zugriff mehr, weder ueber den alten noch ueber den neuen Port.
hat mir da jemand ein tip oder besser eine Loesung :-)?
thx | | | | | Links zum gleichem Thema: | | | | | | | Super Profi Benutzer
Status: Offline Beiträge: 2,161 Registriert seit: 28.09.2004 Ort: Wettswil am Albis Alter: 29 | 
21.03.2006, 18:47
Was steht in der /etc/xinetd.d/sshd ?
Hast du eine Firewall davor? (Soft- oder Hardware)
Was sagt "netstat -nlt" oder "netstat -a | grep LISTEN"?
bis bald
Kermit | | | | | | | | Super Profi Benutzer
Status: Offline Beiträge: 1,806 Registriert seit: 10.01.2005 Ort: Germanien | 
21.03.2006, 19:45
Kann es sein dass eine Firewall läuft (iptables) die nur Port 22 zulässt?
Ach - hat ja kermit das Frog schon erwähnt seh ich gerade.  CCNA, MCSE ...
640-801 / 642-551 / 642-502 / 70-292 / 70-215 / 70-270 / 70-216 / 70-217 / 70-218 / 70-219 / 70-224 / LPI 101 / LPI 102 | | | | | | | | Fortgeschrittener Benutzer
Status: Offline Beiträge: 102 Registriert seit: 01.09.2004 Ort: Zürich Alter: 23 | 
21.03.2006, 21:35
danke kermit.
ja habe eine hardware firewall laufen. der rechner steht jedoch in der DMZ. und es funktioniert auch intern nicht.
"/etc/xinetd.d/sshd" diese datei existiert bei mir gar nicht
netstat -nlt ergibt bei mir folgendes Code: Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:32769 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5335 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
...und netstat -a | grep LISTEN Code: tcp 0 0 *:32769 *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 localhost.localdomain:ipp *:* LISTEN
tcp 0 0 localhost.localdomain:5335 *:* LISTEN
tcp 0 0 localhost.localdomain:smtp *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
unix 2 [ ACC ] STREAM LISTENING 7419 /tmp/.gdm_socket
unix 2 [ ACC ] STREAM LISTENING 143455 @/tmp/fam-root-
unix 2 [ ACC ] STREAM LISTENING 6165 /dev/gpmctl
unix 2 [ ACC ] STREAM LISTENING 6227 /tmp/.font-unix/fs7100
unix 2 [ ACC ] STREAM LISTENING 7481 /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 143295 /tmp/ssh-tskmio5739/agent.5739
unix 2 [ ACC ] STREAM LISTENING 143388 /tmp/ksocket-root/kdeinit__0
unix 2 [ ACC ] STREAM LISTENING 143390 /tmp/ksocket-root/kdeinit-:0
unix 2 [ ACC ] STREAM LISTENING 5576 /var/run/sdp
unix 2 [ ACC ] STREAM LISTENING 143395 /tmp/.ICE-unix/dcop5840-1142972828
unix 2 [ ACC ] STREAM LISTENING 143586 /tmp/.ICE-unix/5864
unix 2 [ ACC ] STREAM LISTENING 143421 /tmp/ksocket-root/klauncherBWubya.slave-socket
unix 2 [ ACC ] STREAM LISTENING 5880 /var/run/acpid.socket
unix 2 [ ACC ] STREAM LISTENING 6279 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 143304 @/tmp/dbus-AH3DFzbAby
unix 2 [ ACC ] STREAM LISTENING 143608 /tmp/mcop-root/limestreet-16e3-442061a5
unix 2 [ ACC ] STREAM LISTENING 143950 /tmp/orbit-root/linc-16f8-0-4e2c49519c63b
unix 2 [ ACC ] STREAM LISTENING 143771 /tmp/orbit-root/linc-16f7-0-60685cb4ddfc6
unix 2 [ ACC ] STREAM LISTENING 143783 /tmp/orbit-root/linc-16f2-0-3b290c189de77
unix 2 [ ACC ] STREAM LISTENING 6408 @/tmp/hald-local/dbus-X2svcYXfVj
unix 2 [ ACC ] STREAM LISTENING 144015 /tmp/orbit-root/linc-1701-0-41a24a4c9747d
unix 2 [ ACC ] STREAM LISTENING 144046 /tmp/orbit-root/linc-1706-0-1923e29fbdecf
unix 2 [ ACC ] STREAM LISTENING 144085 /tmp/orbit-root/linc-16f4-0-633138f419483
unix 2 [ ACC ] STREAM LISTENING 144419 /tmp/orbit-root/linc-174b-0-2610b5edeaa6f
| | | | | | | | Super Profi Benutzer
Status: Offline Beiträge: 2,161 Registriert seit: 28.09.2004 Ort: Wettswil am Albis Alter: 29 | Re: SSH standard port aendern -
21.03.2006, 21:52
Zitat: Original geschrieben von garfield salut
ich habe versucht auf Linux Fedora Core 4 den port von ssh (standard 22) mittels der datei /etc/ssh/sshd_conf abzuaendern. Nach dem restart des sshd daemon (/etc/init.d/sshd restart) habe ich jedoch keinen ssh Zugriff mehr, weder ueber den alten noch ueber den neuen Port.
hat mir da jemand ein tip oder besser eine Loesung :-)?
thx | Wie es scheint, läuft bei dir der sshd immer noch auf Port 22! Der Port ist zumindest noch offen und horcht!
Hast du die ssh_conf oder die ssh d_conf abgeändert?
Habe bei mir gerade eine neue FC5 und bin auch gleich selbst reingefallen: Ich hab die ssh_conf angepasst, was dann nicht den gewünschten Effekt brachte.
Als ich jedoch sshd_conf angepasst hab (Port 222) und mit /etc/init.d/sshd restart den Dienst neu startete, lief der Daemon wie gewünscht auf Port 222.
bis bald
Kermit | | | | | | | | Super Profi Benutzer
Status: Offline Beiträge: 2,161 Registriert seit: 28.09.2004 Ort: Wettswil am Albis Alter: 29 | 
21.03.2006, 21:54
Ach, und noch was: Der sshd kann nicht so hoch springen: Bist du sicher, dass du den Zaun (#) entfernt hast?
bis bald
Kermit | | | | | | | | Fortgeschrittener Benutzer
Status: Offline Beiträge: 102 Registriert seit: 01.09.2004 Ort: Zürich Alter: 23 | 
21.03.2006, 22:10
sorry hatte es wieder zurück geändert. habe es jetzt nochmals gemacht hier meine sshd_config. nach dem restart ging kein ssh mehr.....
was könnte das nur sein?? Code: # $OpenBSD: sshd_config,v 1.70 2004/12/23 23:11:00 djm 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 222
#Protocol 2,1
Protocol 2
#AddressFamily any
#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 1h
#ServerKeyBits 768
# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
# 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
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes
# 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 mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
#UsePAM no
UsePAM yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#ShowPatchLevel no
# no default banner path
#Banner /some/path
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
Code: Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:32769 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5335 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::222 :::* LISTEN
| | | | | | | | Super Profi Benutzer
Status: Offline Beiträge: 2,161 Registriert seit: 28.09.2004 Ort: Wettswil am Albis Alter: 29 | 
21.03.2006, 22:22
Im Gegensatz zu vorher (tcp 0 0 :::22 :::* LISTEN) horcht sshd nun auf Port 222! (tcp 0 0 :::222 :::* LISTEN)
Frage: Wie (mit welchem Befehl/Programm) nimmst du mit dem Server Kontakt auf?
bis bald
Kermit | | | | | | | | Super Profi Benutzer
Status: Offline Beiträge: 1,806 Registriert seit: 10.01.2005 Ort: Germanien | 
21.03.2006, 22:30
Äh Port 222 ist schon belegt von Dienst rsh-spx! Wie wäre es, es mal mit Port 24 zu probieren? CCNA, MCSE ...
640-801 / 642-551 / 642-502 / 70-292 / 70-215 / 70-270 / 70-216 / 70-217 / 70-218 / 70-219 / 70-224 / LPI 101 / LPI 102 | | | | | Links zum gleichem Thema: | | | | | | | Fortgeschrittener Benutzer
Status: Offline Beiträge: 102 Registriert seit: 01.09.2004 Ort: Zürich Alter: 23 | 
21.03.2006, 22:35
@kermit
ich benutze putty unter win xp zum connecten.
@spacyfreak
danke, aber ich habe schon ethliche ports versucht glaub mir. es funktioniert mit keinem (zb. 16161, 222, 22223, ...)
...ich glaube ich installire mir in den nächsten Tagen mal FC5, vielleicht ist das Problem dann behoben?! | | | | | | | | Super Profi Benutzer
Status: Offline Beiträge: 2,161 Registriert seit: 28.09.2004 Ort: Wettswil am Albis Alter: 29 | 
21.03.2006, 22:42
Zitat: Original geschrieben von spacyfreak Äh Port 222 ist schon belegt von Dienst rsh-spx! Wie wäre es, es mal mit Port 24 zu probieren? | Da magst du im allgemeinen Recht haben, Spacyfreak, aber bei garfield war 222 vorher noch unbelegt.
Ausserdem, ist dir Berkeley rshd mit SPX authentifizierung schon mal IRL begegnet? Ich wusste bis gerade nichteinmal, was das ist!
Port 24 wäre ja für "any private mail system" reserviert.
Garfield will wohl den bruteforce-Scripts Knüppel zwischen die Beine legen...
bis bald
Kermit | | | | | | | | Super Profi Benutzer
Status: Offline Beiträge: 2,161 Registriert seit: 28.09.2004 Ort: Wettswil am Albis Alter: 29 | 
21.03.2006, 22:46
Zitat: Original geschrieben von garfield @kermit
ich benutze putty unter win xp zum connecten.
@spacyfreak
danke, aber ich habe schon ethliche ports versucht glaub mir. es funktioniert mit keinem (zb. 16161, 222, 22223, ...)
...ich glaube ich installire mir in den nächsten Tagen mal FC5, vielleicht ist das Problem dann behoben?! | Mit Putty solltest du den Port im GUI eintragen können. Ich denke mit 192.168.1.100:222 klappt das da nicht.
Ausserdem wäre es interessant, ob du dich lokal auf der Maschine verbinden kannst.
Ich habe heute das erste mal Fedora selber installiert, kann also über dessen Vorgänger nichts sagen... Ausser dass du damit das selbe erreichen wirst:
Tatsache ist, dass bei dir der Port 222 offen ist!
bis bald
Kermit
Geändert von kermit (21.03.2006 um 22:49 Uhr).
| | | | | | | | Profi Benutzer
Status: Offline Beiträge: 589 Registriert seit: 22.03.2004 Ort: Raum Zürich Alter: 23 | 
22.03.2006, 07:34
Las mal den Port 22 drinnen und füg sonst einfach noch einen hinzu!
Bsp. Zitat:
# $OpenBSD: sshd_config,v 1.70 2004/12/23 23:11:00 djm 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
Port 444
#Protocol 2,1
Protocol 2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
| [Hier könnte Ihre Werbung stehen! Banner, Links, IntelliTXT, was das Herz begehrt!] | | | | | | | | Fortgeschrittener Benutzer
Status: Offline Beiträge: 102 Registriert seit: 01.09.2004 Ort: Zürich Alter: 23 | 
22.03.2006, 10:24
@Maverick
Danke. Habs gerade ausprobiert. Habe nochmals netstat angeschaut, horcht jetzt auf beide Ports. Jedoch kann ich mich nur auf Port 22 connecten, extern wie auch intern. | | | | | | | | Profi Benutzer
Status: Offline Beiträge: 589 Registriert seit: 22.03.2004 Ort: Raum Zürich Alter: 23 | 
22.03.2006, 11:18
Ein echt komisches Phänomen! Sagt evtl. die Bugseite von Fedora irgendwas darüber? [Hier könnte Ihre Werbung stehen! Banner, Links, IntelliTXT, was das Herz begehrt!] | | | | | | |