sftp will nicht funktionieren.

al3x

New Member
Nach 3 Tagen fummeln und schlaflose Nächte wende ich mich nun verzweifelt an euch.

Ich habe ein NAS von Buffalo Linkstation Live auf dem ich gerne openssh zum laufen bekommen muss. Ich habe die optware erfolgreich installiert.
Anschließend habe ich openssh installiert. Es wurden auch alle nötigen keys(RSA / DNA) generiert bei der installation.

unter /etc befindet sich die sshd_config.

Subsystem sftp /usr/local/libexec/sftp-server

ist bereits auch eingetragen und der pfad stimmt zu der sftp-server Datei.

Ich kann nun mit Putty über SSH eine Verbindung aufbauen.

Aber mit WINSCP oder Filezilla kann ich mich nicht über sftp verbinden lassen.
WINSCP läuft dann im SCP Modus..

Habe es auserdem noch mit SSHSecureShellClient-3.2.9 for workstation probiert, dort komem ich auch auf die Shell.
Das sftp Programm sagt jedoch: Most likely the sftp-server is not in the path of the on the server-side

Hat jemand eine Idee? Wäre um jede Hilfe sehr dankbar
 
Den Befehl fuer den Logauszug müstest du mir sagen, bin relativ frisch in Linux.

Ich poste dir mal die sshd_config

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

# HostKey for protocol version 1
#HostKey /etc/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh_host_rsa_key
#HostKey /etc/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

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

# For this to work you will also need host keys in /etc/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

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCreds yes

# Set this to 'yes' to enable PAM authentication (via challenge-response)
# and session processing. Depending on your PAM configuration, this may
# bypass the setting of 'PasswordAuthentication'
#UsePAM yes

#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#KeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10

# no default banner path
#Banner /some/path

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

ein find / bringt folgendes Ergebnis

Code:
root@LINKSTATION:~# find / -name sftp-server
/home/usr/local/libexec/sftp-server
find: /proc/24462: No such file or directory
find: /proc/24463: No such file or directory
find: /proc/24466/task: No such file or directory
find: /proc/24466/fd: No such file or directory
/usr/local/libexec/sftp-server

hatte ein useradd gemacht ohne --shell deswegen hab ich da einen leern Ordner unter /home/usr/local/libexec/

Hab es gefunden mit den log Datein!

Ich krieg hier mächtig Angst hier innerhalb von wenigen minuten sidn 2 User dran sich auf meinem Systemein zuloggen
Code:
Mar  8 15:11:06 LINKSTATION sshd[16580]: Received disconnect from 61.240.131.173: 11: Bye Bye
Mar  8 15:11:09 LINKSTATION sshd[16657]: Failed password for root from 61.240.131.173 port 58479 ssh2
Mar  8 15:11:09 LINKSTATION sshd[16657]: Received disconnect from 61.240.131.173: 11: Bye Bye
Mar  8 15:11:13 LINKSTATION sshd[16713]: Failed password for root from 61.240.131.173 port 58635 ssh2
Mar  8 15:11:13 LINKSTATION sshd[16713]: Received disconnect from 61.240.131.173: 11: Bye Bye
Mar  8 15:11:16 LINKSTATION sshd[16799]: Failed password for root from 61.240.131.173 port 58844 ssh2
Mar  8 15:11:16 LINKSTATION sshd[16799]: Received disconnect from 61.240.131.173: 11: Bye Bye
Mar  8 15:11:19 LINKSTATION sshd[16855]: Failed password for root from 61.240.131.173 port 59006 ssh2
Mar  8 15:11:19 LINKSTATION sshd[16855]: Received disconnect from 61.240.131.173: 11: Bye Bye
Mar  8 15:11:24 LINKSTATION sshd[16916]: Failed password for root from 61.240.131.173 port 59158 ssh2
Mar  8 15:11:25 LINKSTATION sshd[16916]: Received disconnect from 61.240.131.173: 11: Bye Bye
Mar  8 14:56:56 LINKSTATION sshd[30703]: Received disconnect from 210.110.180.116: 11: Bye Bye
Mar  8 14:56:59 LINKSTATION sshd[30763]: Failed password for root from 210.110.180.116 port 37892 ssh2
Mar  8 14:56:59 LINKSTATION sshd[30763]: Received disconnect from 210.110.180.116: 11: Bye Bye
Mar  8 14:57:02 LINKSTATION sshd[30822]: Failed password for root from 210.110.180.116 port 38060 ssh2
Mar  8 14:57:03 LINKSTATION sshd[30822]: Received disconnect from 210.110.180.116: 11: Bye Bye
Mar  8 14:57:05 LINKSTATION sshd[30879]: Failed password for root from 210.110.180.116 port 38214 ssh2
Mar  8 14:57:06 LINKSTATION sshd[30879]: Received disconnect from 210.110.180.116: 11: Bye Bye
Mar  8 14:57:09 LINKSTATION sshd[30947]: Failed password for root from 210.110.180.116 port 38364 ssh2
Mar  8 14:57:09 LINKSTATION sshd[30947]: Received disconnect from 210.110.180.116: 11: Bye Bye
Mar  8 14:57:12 LINKSTATION sshd[31010]: Failed password for root from 210.110.180.116 port 38522 ssh2
Mar  8 14:57:12 LINKSTATION sshd[31010]: Received disconnect from 210.110.180.116: 11: Bye Bye

Das zum Thema sicherheit, scheint mir irgendwie alles schlimmer zu sein als vorher, trau mich ketzt gar nicht mehr die Box an zu machen....

Habe aber noch ein interessanten Eintrag gefunden

Code:
Mar  8 15:05:32 LINKSTATION sshd[9393]: Accepted password for affe from xx.xx.xx.xx port 2027 ssh2
Mar  8 15:05:32 LINKSTATION sshd[9393]: subsystem request for sftp
Mar  8 15:05:32 LINKSTATION sshd[9393]: error: subsystem: cannot stat /opt/libexec/sftp-server: No such file or directory
Mar  8 15:05:32 LINKSTATION sshd[9393]: subsystem request for sftp failed, subsystem not found
 
Last edited by a moderator:
Probier mal
Code:
echo "/usr/local/libexec/sftp-server" >> /etc/shells

Danach solltest du dich über das sftp-Subsystem einloggen können.
 
cannot stat /opt/libexec/sftp-server: No such file or directory
Den Pfad wird sich dein sshd hoffentlich nicht selbst ausgedacht haben. Was sagt ein egrep -R '/opt/libexec/sftp-server' /etc/ /opt/
 
Den Pfad wird sich dein sshd hoffentlich nicht selbst ausgedacht haben. Was sagt ein egrep -R '/opt/libexec/sftp-server' /etc/ /opt/


Der Befehl ist nicht ausführbar, aber nicht weiter schlimm, habe es zum laufen gebracht mittels Subsystem sftp internal-sftp, seit dem koennen sich alle User einloggen.


Ich versuche nun fuer meine 2 User RSA Keys zu generieren.
Mit dem user "root" ist das auch kein Problem.
Code:
ssh-keygen -t rsa
anschließend habe ich
Code:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys"
War das so korrekt?

Mich wundert, das der User root sich in dem ordner root befindet und nicht in / , ist das normal?
Ich habe ein Bild gemacht damit man es versteht, fals ich mich komisch ausgedruckt haben sollte.

KLICKME

Ich denke in etc/passwd müste man das ändern, aber ich hab halt tierisch schiss da was zu ändern, habs mal geschafft mit chown root:root mich auszusperren.

Code:
root:x:0:0:root:/root:/bin/sh
 
Last edited by a moderator:
Mich wundert, das der User root sich in dem ordner root befindet und nicht in / , ist das normal?
Ich habe ein Bild gemacht damit man es versteht, fals ich mich komisch ausgedruckt haben sollte.

KLICKME

Ich denke in etc/passwd müste man das ändern, aber ich hab halt tierisch schiss da was zu ändern, habs mal geschafft mit chown root:root mich auszusperren.

Code:
root:x:0:0:root:/root:/bin/sh
Der User root hat standardmäßig immer /root als home-dir, das ist ganz normal. Ich würde das auch nicht ändern, wozu auch?
 
Ich habe mit meinen anderen Usern nicht die Chance keys zu generieren , da

ssh-keygen -t rsa

gesperrt ist, wie kann man das mit dem Nutzer root lösen?
 
Back
Top