Beiträge von jonas_linhose

    Hallo,


    vielen Dank für den Hinweis, allerdings finde ich dort keinen Hinweis auf mein eigentliches Problem:


    Die Anmeldung mit anderen Nutzern usw. funktioniert ja nur die Anmeldung mit einem Nutzer UNGLEICH admin
    per DSA-Key funktioniert aus (für mich) unerfindlichen Gründen nicht.


    Evtl. zu diesem konkreten Problem noch einer eine Idee...

    Hallo,


    ich habe anhand der Anleitung


    Zitat


    den SSH-Server ersetzt und kopiere bei jedem Neustart über die autorun.sh die Einstellungen für den SSH-Server (sshd_config) sowie den link zum alternativen SSH-Server erneut über die zurückgesetzten Standardeinstellungen.


    Hier die sshd_config:


    Code
    [/tmp/config] # cat autorun.sh#!/bin/sh# location: /share/custom/scripts/contab.sh# script name: crontab script# purpose: add entries to the crontab, which will survive a QNAP reboot# designed for Qnap TS-201# Testmail f. Autorun.sh#/bin/cp /tmp/config/login.sh /tmp;/bin/sh /tmp/login.sh restart &#run openssh script to update ssh daemon#./openssh.sh################################################### Benutzerdefinierte Eintraege in der Crontab ####################################################Variable zuweisencrontab=/etc/config/crontabecho $crontab#Pruefen ob Eintrag schon vorhandencat $crontab | grep backup_script_bsshveltenergebnis=$?echo $ergebnis#If-Abfrage bzgl. fehlendem Eintragif [ $ergebnis -eq 0 ]    then echo "der Eintrag ist bereits vorhanden"    else echo "der Eintrag ist noch nicht vorhanden"         echo "45 22 * * * /share/HDA_DATA/bsshvelten/.ssh/backup_script_bsshvelten.sh" >> $crontab  fi#veraenderte Crontab laden#Pruefen ob Eintrag schon vorhandencat $crontab | grep backup_script_bsshveltenergebnis=$?echo $ergebnis#If-Abfrage bzgl. fehlendem Eintragif [ $ergebnis -eq 0 ]    then echo "der Eintrag ist bereits vorhanden"    else echo "der Eintrag ist noch nicht vorhanden"         echo "45 22 * * * /share/HDA_DATA/bsshvelten/.ssh/backup_script_bsshvelten.sh" >> $crontab  fi#veraenderte Crontab ladencrontab $crontab# restart crontab/etc/init.d/crond.sh restart########################################## Systemlink zum SSH-Server ersetzen ########################################## rm /usr/sbin/sshd ln -s /opt/sbin/sshd /usr/sbin/sshd###################################################################### sshd_config nach dem Neustart mit einer individuellen ersetzen ######################################################################rm /etc/ssh/sshd_configcp /share/HDA_DATA/.qpkg/Optware/etc/openssh/sshd_config   /etc/ssh/sshd_config


    und hier die sshd_config


    Code
    # $OpenBSD: sshd_config,v 1.74 2006/07/19 13:07:10 dtucker Exp $# 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 change a# default value.#Port 22#Protocol 2,1Protocol 2#AddressFamily any#ListenAddress 0.0.0.0#ListenAddress ::# HostKey for protocol version 1#HostKey /etc/ssh/ssh_host_key# HostKeys for protocol version 2HostKey /etc/ssh/ssh_host_rsa_keyHostKey /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#LogLevel INFO# Authentication:#LoginGraceTime 2m#PermitRootLogin yes#StrictModes yes#MaxAuthTries 6RSAAuthentication yesPubkeyAuthentication yesAuthorizedKeysFile ~/.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# Change to no to disable s/key passwords#ChallengeResponseAuthentication yes# 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 no#AllowTcpForwarding yes#GatewayPorts no#X11Forwarding no#X11DisplayOffset 10#X11UseLocalhost yes#PrintMotd yes#PrintLastLog yes#TCPKeepAlive yes#UseLogin noUsePrivilegeSeparation no#PermitUserEnvironment no#Compression delayed#ClientAliveInterval 0#ClientAliveCountMax 3UseDNS no#PidFile /var/run/sshd.pid#MaxStartups 10#PermitTunnel no# no default banner path#Banner /some/path# override default of no subsystemsAllowUsers admin test# Example of overriding settings on a per-user basis#Match User anoncvs# X11Forwarding no# AllowTcpForwarding no# ForceCommand cvs server


    Es funktioniert auch soweit folgendes ohne Probleme:


    1. Die Anmeldung per SSH als admin auf dem NAS
    2. Die Anmeldung per SSH als test auf dem NAS


    damit die Homeverzeichnisse funktionieren habe ich diese für den admin und test wie folgt verlinkt


    Code
    lrwxrwxrwx    1 admin    administ       22 Nov  8 00:09 /home/admin -> /share/HDA_DATA/admin/


    Somit funktioniert die Anmeldung auch ohne Fehlermeldung bzgl. eines fehlenden Homeverzeichnisses.


    Dann habe ich auf meinem Ubuntu-Server einen SSH Schlüssel generiert


    Code
    ssh-keygen -t dsa -f /root/.ssh/test_nas


    und diesen auf das NAS kopiert:


    Code
    ssh-copy-id  -i /root/.ssh/test_nas.pub admin@*****.dyndns.org


    Jetzt funktioniert auch die Anmeldung mittels Schlüssel auf dem NAS ohne Kennwort als Admin auf dem NAS.


    Anschließend habe ich das Ganze noch mal für den User test wiederholt, auch das funktionierte ohne Probleme.
    Die Ausgabe von


    Code
    cat ~/.ssh/authorized_keys

    (als test - nutzer auf dem NAS angemeldet)
    ist identisch mit

    Code
    cat /home/admin/.ssh/authorized_keys


    Also wurde der Schlüssel korrekt auf das NAS kopiert.


    Allerdings ist die Anmeldung per SSH und der Schlüsselauthentifizierung als user test auf dem NAS nicht möglich.


    Hat von euch einer eine Idee was ich übersehen habe! wie man das noch lösen kann?


    Vielen Dank im Vorraus, ich hoffe ich habe alle erforderlichen Daten hier aufgeführt.