Hi,
For an unknown reason, all my FTP accesses (sftp) don’t work anymore.
So I checked around and in HestiaCP admin dashboard, if I click the Configure cog icon, it shows ssh as red. Since SFTP uses port 22 I guess that’s the reason why .
I can’t ssh either using a password. Actually, I have added an ssh key and that’s how I connect.
But I just don’t understand why I can’t ftp anymore.
Any idea what could be wrong?
Could an Ubuntu update have messed up with something?
Thanks,
I did that, it doesn’t do anything. Restart. Start.
Nothing in logs besides stating it’s started but remains red Service started (Name: ssh).
Each time I try to sftp, I have a permission denied.
If I reset root password to something very basic, it still says the same thing, so it’s obviously not the credentials that are wrong.
In the firewall, port 22 is Accept for 0.0.0.0/0
If I replace that with a fixed IP, still no access
Default sshd configuration does not allow root login with password. Its best to not alter that restriction either, lest your HestiaCP server become a malicious zombie in short order.
Do you have a user with SFTP privileges?
Even when using a less privileged user than root, it is still advisable to require SSH keys for authentication whenever possible. If you haven’t worked with SSH keys this article offers guidance on issuing an ed25519 key.
Hi @linkp
Thanks for your input.
Yes, I do have a specific user for sftp but it doesn’t work either.
And there is no chance for it to work since the ssh service that manages port 22 is always down now, despite it says it correctly started when using the config restart button.
So that means nobody can ftp to my server anymore.
I do use ssh keys for passwordless login and that works. But I need to be able to ftp from any computer, that’s why I need to be able to login with credentials.
But Port22 being closed for I don’t know why… this is not working.
And I had no problems before, I have all my CI/CD and all my 11 websites published to my VPS through SFTP without ssh keys, only user/password.
Everything has stopped working. Very strange.
I checked on the VPS itself and I don’t use any kind of firewall protection on their side, I do everything through HestiaCP to make sure nothing gets messed up.
Mmhhh…
Interesting: a restart shows this: Failed to restart sshd.service: Unit sshd.service not found.
The other commands don’t work since sshd.service is not found.
Ok more on this.
I had ssh back to green and it’s working.
I checked ls -l /etc/systemd/system/multi-user.target.wants/ and there were no ssh.service symlink there, meaning disabled when rebooting.
So I ran sudo systemctl enable ssh.service which created the link and ran sudo systemctl daemon-reload to reload.
Ok, after enabling ssh.service and then adding your line to the sshd_config file, I noticed I set internal-server instead of internal-**sftp** which was matched further down for all sftp user connections.
It works now for all my SFTP connections.
Gee, thanks a lot for all your help.
But it’s still a mystery why the ssh.service was disabled and why ssh_config didn’t have the internal-sftp reference anymore.
Crazy.
But thanks to you, I’m back on my four legs!
Steve