SCP connection closed

Hello everyone,
Since last two weeks i am facing a new issue in SSH. whenever i am trying to add some more files on my VPS using SCP then it says connection closed. I tried almost everything like reinstalling SSH, enabling and disabling. But nothing works. In fresh install of Hestia it works only within 1st 10 min and after that it stop working.

Hi @rabby

But, can you connect using ssh?

Show the output of these commands?

grep -Ev '^#|^$' /etc/ssh/sshd_config
iptables -S
ls -lR /srv/

Out is so long. Please be specific what i need to look. Because everything else is working on my server except SCP.

If SSH is working SCP should work too, maybe you mean SFTP?

grep -Ev '^#|^$' /etc/ssh/sshd_config
iptables -S
ls -la /srv/ftp/
ls -la /srv/jail/

Untitled design
See this screenshot

Whenever i am trying to do SCP file transfer i face this.

Show the output of the commands (copy and paste the output, no screenshots please).

Do you access via ssh using root user and password?

yes i access via SSH using root.

Include /etc/ssh/sshd_config.d/*.conf
LoginGraceTime 1m
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
DebianBanner no
AcceptEnv LANG LC_*
Subsystem sftp internal-sftp-server
PermitRootLogin yes
HostKeyAlgorithms +ssh-rsa
 
Match User sftp_dummy99,rabby,akkvc,coskot,grkvc,kodetree,lifeline,mukt,nashachudaokender,nashamuktipunjab,rahul_keyanntech,testing,grkvc_dev
    ChrootDirectory /srv/jail/%u
    X11Forwarding no
    AllowTCPForwarding no
    ForceCommand internal-sftp -d /home/%u

Execute these commands and try again:

sed -i 's/internal-sftp-server/internal-sftp/' /etc/ssh/sshd_config
systemctl restart ssh

Yes, Great it works. i trying everything with chatGPT. How can i learn how to handle server any complete guide please share reference.

Thanks

Great! :wink:

I’ve never actually read a complete guide on how to manage Linux. I’ve gone through tons of articles, specific how-tos for certain services, and lots of forum posts, but I’ve never used a guide that tries to cover everything. So I’m afraid I can’t really recommend one.

2 Likes