Tiny Core Base > Raspberry Pi
piCore 14.x sftp not working after update from 13.x?
Cheembus:
Hello all,
I recently updated my 13.x piCore on my raspi 3 model B to version 14, and updated all the required extensions. Previously when it was version 13 I had an SFTP server running on it that I used semi-frequently. As of updating to version 14, I can't seem to log in to the piCore through sftp and access the server. Every time I try to log in, it asks for my user password, and when I enter it in correctly I immediately get booted out with the error message:
--- Code: ---sftp www-data@raspivpn
www-data@raspivpn's password:
Connection to raspivpn closed by remote host.
Connection closed.
Connection closed
--- End code ---
All my other ssh capabilities are functioning correctly, I can ssh into my tc user, do scp, rsync, etc.
I know that this type of error is usually caused by directory permissions problems, but to my knowledge I have all the directories with the correct permissions.
The following is an excerpt from my sshd_config, and the permissions of my directories:
--- Code: ---
Subsystem sftp /usr/local/lib/openssh/sftp-server
# sftp stuff
Match User www-data
ChrootDirectory /mnt/www
ForceCommand internal-sftp
PasswordAuthentication yes
AllowTcpForwarding no
X11Forwarding no
ClientAliveInterval 60
--- End code ---
--- Code: ---drwxr-xr-x 10 root root 200 Apr 2 15:34 mnt/
drwxr-xr-x 7 root root 140 Apr 2 15:34 www/
--- End code ---
I've been scratching my head over this for the last 2 days. What am I doing wrong here?
patrikg:
Can you check if the file are there:
--- Code: ---ls -l /usr/local/lib/openssh/sftp-server
--- End code ---
Or maybe on another path.
Cheembus:
--- Quote from: patrikg on April 02, 2024, 12:51:24 PM ---Can you check if the file are there:
--- Code: ---ls -l /usr/local/lib/openssh/sftp-server
--- End code ---
Or maybe on another path.
--- End quote ---
--- Code: ---lrwxrwxrwx 1 root root 53 Jan 1 1970 /usr/local/lib/openssh/sftp-server -> /tmp/tcloop/openssh/usr/local/lib/openssh/sftp-server
--- End code ---
Yes, I can confirm it is there.
patrikg:
When debugging ssh the option -v is your friend.
So you can try to add that to your scp command like this, to get more info what the ssh doing.
--- Code: ---scp -v tc@localhost:/home/tc/myfile myfile
--- End code ---
And you could try to use the tc user.
And do you have www-data as user ?
And what I am seeing is the owner of the directory is root.
So you have lots of user errors.
Cheembus:
--- Quote ---And do you have www-data as user ?
--- End quote ---
ssh to the user tc gives no problems, its the user www-data that is causing problems. www-data does in fact exist as a user, I can see it in my passwd and shadow files. I can also attempt to login as www-data via the tty terminal (it kicks me out immediately because I have the shell set to /bin/false on purpose). For the record, if I intentionally type in the wrong password when trying to sftp or ssh as the user www-data, it tells me explicitly that the password is incorrect, so it is able to verify the login, it just unexpectedly drops.
Doing either -vvv on ssh or sftp for www-data@raspi results in a vague error:
--- Code: ---Authenticated to raspivpn ([X.X.X.X]:22) using "password".
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: filesystem
debug3: send packet: type 1
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
#0 client-session (t3 nr0 i0/0 o0/0 e[write]/0 fd 4/5/6 sock -1 cc -1 io 0x00/0x00)
Connection to raspivpn closed by remote host.
Transferred: sent 2980, received 2516 bytes, in 0.0 seconds
Bytes per second: sent 159785.5, received 134906.1
debug1: Exit status -1
Connection closed.
Connection closed
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version