Probleme mit ssh

Joschie

Benutzer
Mitglied seit
10. Jul 2023
Beiträge
141
Punkte für Reaktionen
3
Punkte
18
Guten abend,

bin im Besitz eines DS723+ mit "DSM 7.2-64570 Update 1".

Mein SSH scheint aktuell nicht benutzbar zu sein. Wäre für Tipps dankbar. Es muss irgendwas Kleines sein. Wobei ich schon relativ viel geändert habe. Firewall, Benutzer ....

Meine aktuelle Firewall:

1701805893212.png
Die folgenden Benutzer gibt es in meinem System:
1701806301014.png
Wobei der Benutzer "admin" deaktiviert zu sein scheint. Ist das normal? Oder habe ich das selber gemacht? :rolleyes:
Mit "DerKleineMuck" komme ich nicht per ssh rein.

Für administrative Zwecke habe ich folgende Benutzer:
1701806496214.png

Was die Ports an geht habe ich folgende Einstellungen für SSH festgelegt:
1701806740694.png

Wobei unter Dateidiensten/rsync noch folgendes steht:
1701806839705.png
Der Port 22 führt zu "Connection refuse" und die Ports 51022/56022 scheint er zu nehmen, aber nach Passwort Eingabe und einigen Sekunden Bedenkzeit springt er zurück zur Passwort-Eingabe.

Per Telnet komme ich aktuell rein.

Habt Ihr eine Idee woran es liegen könnte?

Grüße
 

Hagen2000

Benutzer
Mitglied seit
25. Mai 2016
Beiträge
107
Punkte für Reaktionen
25
Punkte
28
SSH ist nur Benutzern der Gruppe „administrators“ gestattet. Siehe auch Überschrift in deinem 4. Bild.
Und das Konto „admin“ sollte man nicht benutzen, daher hast du es wahrscheinlich schon gesperrt.
 

Joschie

Benutzer
Mitglied seit
10. Jul 2023
Beiträge
141
Punkte für Reaktionen
3
Punkte
18
Mit Telnet komme ich rein. Kann ich den SSH Server manuell im Debug Modus laufen lassen um festzustellen was nicht stimmt?

Hier die sshd_config:

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

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

# 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 override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
#AuthorizedKeysFile    .ssh/authorized_keys

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# 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

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

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

# GSSAPI options
#GSSAPIAuthentication no
#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 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

#AllowAgentForwarding yes
AllowTcpForwarding no
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# override default of no subsystems
#Subsystem    sftp    /usr/libexec/sftp-server
Subsystem       sftp    internal-sftp -f DAEMON -u 000

# Example of overriding settings on a per-user basis
#Match User anoncvs
#    X11Forwarding no
#    AllowTcpForwarding no
#    PermitTTY no
#    ForceCommand cvs server
Match User root
    AllowTcpForwarding yes
Match User admin
    AllowTcpForwarding yes
Match User anonymous
    AllowTcpForwarding no
    GatewayPorts no

Sieht für mich aber nicht so aus, dass SSHD den Port 51022 verwendet.
 
Zuletzt bearbeitet:

plang.pl

Benutzer
Contributor
Sehr erfahren
Maintainer
Mitglied seit
28. Okt 2020
Beiträge
14.180
Punkte für Reaktionen
4.915
Punkte
519
Meine config sieht auch so aus, obwohl ich den Port geändert habe. Bei mir klappt es.
Mit welchem User versuchst du dich anzumelden?
Es muss wie bereits geschrieben ein User aus der Gruppe administrators sein.
Mach doch mal testweise die Firewall aus. Wobei es daran nicht hängen sollte, wenn die PW-Abfrage erscheint.
DS mal neu gestartet? Du kannst auch mal nen anderen Port für ssh setzen, speichern, dann den Port wieder ändern und erneut speichern.
 

Joschie

Benutzer
Mitglied seit
10. Jul 2023
Beiträge
141
Punkte für Reaktionen
3
Punkte
18
Bin weiter gekommen. Unter Telnet habe ich den Befehl <systemctl status sshd> ausgeführt um mehr Informationen zu bekommen:
Bash:
ash-4.4# systemctl status sshd
● sshd.service - OpenBSD Secure Shell server
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: disabled)
  Drop-In: /usr/local/lib/systemd/system/sshd.service.d
           └─synorelay-service-handler.conf
   Active: active (running) since Wed 2023-12-06 03:47:48 CET; 2h 38min ago
 Main PID: 8041 (sshd)
   CGroup: /sshd.slice/sshd.service
           └─8041 sshd: /usr/bin/sshd -D [listener] 0 of 10-100 startups

Dec 06 04:24:00 feldNAS sshd[21138]: Invalid user DerKleineMuck from 192.168.178.59 port 52178
Dec 06 04:24:24 feldNAS sshd[21138]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.178.59
Dec 06 04:24:24 feldNAS sshd[21138]: pam_syno_log_fail(sshd:auth): Can't get user uid (DerKleineMuck).
Dec 06 04:24:30 feldNAS sshd[21138]: Failed password for invalid user DerKleineMuck from 192.168.178.59 port 52178 ssh2
Dec 06 04:24:50 feldNAS sshd[21138]: Connection closed by invalid user DerKleineMuck 192.168.178.59 port 52178 [preauth]
Dec 06 04:24:58 feldNAS sshd[21207]: Invalid user DerKleineMuck from 192.168.178.59 port 51856
Dec 06 04:25:09 feldNAS sshd[21207]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.178.59
Dec 06 04:25:09 feldNAS sshd[21207]: pam_syno_log_fail(sshd:auth): Can't get user uid (DerKleineMuck).
Dec 06 04:25:14 feldNAS sshd[21207]: Failed password for invalid user DerKleineMuck from 192.168.178.59 port 51856 ssh2
Dec 06 04:25:36 feldNAS sshd[21207]: Connection closed by invalid user DerKleineMuck 192.168.178.59 port 51856 [preauth]

Den Benutzer "DerKleineMuck" existiert nicht nur der Benutzer "DerKleineMuck1976". Anscheinend kommt ssh mit langen Benutzernamen nicht klar?
 

plang.pl

Benutzer
Contributor
Sehr erfahren
Maintainer
Mitglied seit
28. Okt 2020
Beiträge
14.180
Punkte für Reaktionen
4.915
Punkte
519
Bei mir machen Zahlen im Namen keine Probleme
1.png
 

Joschie

Benutzer
Mitglied seit
10. Jul 2023
Beiträge
141
Punkte für Reaktionen
3
Punkte
18
Perfekt :D Ich hatte das 1976 beim Terminal weggelassen. Jetzt gehts. Werde den Benutzernamen kürzen. Danke.
 
  • Like
Reaktionen: dil88


 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat