0

I'm trying to replace a proftp server because the old one was encrypted during installation and the passkey is lost. Old server works fine on ftp:21 and sftp:22/322 old server is on ubuntu 16.04.7 lts new server on the ubuntu 22.04.3 lts I installed proftpd on the new server, openssh was installed during the Ubuntu installation.

The goal is to make the new server identical to the old one. So on the old server the default ssh port was changed from 22 to port 322, proftpd can be accessed on both port 21(default) and Port 22(specified in the /etc/profptd/conf.d/sftp.conf file).

On the new server, Port 22 is enabled for proftpd in the sftp.conf file located in the /etc/profptd/conf.d/sftp.conf

sftp.conf file in /etc/profptd/conf.d/

so I'm able to ssh into both new and old server on port 322 and access both servers on port 21.

I can also use ftp client(WinSCP) to sftp:322 into the both servers, and ftp:21 as well.

The issue now is I can't use ftp client to connect to the new server on port 22 and I'm getting the error below: sftp connection rejected This can be done on the old server and they have the same sftp configuration as stated in the documentation. example configuration from profptd documentation

The following settings was enabled on the new server: /etc/ssh/sshd_config.d *

Port 322
#Port 22
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

PubKeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
HostbasedAuthentication no
IgnoreUserKnownhosts no

PasswordAuthentication yes
KbdInterctiveAuthentication no

UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

The following settings was enabled on the new server: /etc/proftpd/proftpd.conf

*

Include /etc/proftpd/modules.conf
UseIPv6 on

<IfModule mod_ident.c>
 IdentLookups off
</IfModule>

DefaultRoot ~

Port 21

AuthOrder mod_auth_pam.c* mod_auth_unix.c

<IfModule mod_quotab.c>
QuotaEngine off
</IfModule>

<IfModule mod_ratio.c>
Ratios off
</IfModule>

<IfModule mod_delay.c>
DelayEngine on
</IfModule>

<IfModule mod_ctrls.c>
...
</IfModule>

<IfModule mod_ctrls_admin.c>
AdminControlsEngine off
</IfModule>

RequireValidShell off

Include /etc/proftpd/conf.d/

http://www.proftpd.org/docs/contrib/mod_sftp.html#SFTPHostKey

I enabled the ports 21, 22, 322 on the firewall ufw.

I can ssh:322 into the server and I can use sftp:322 and ftp:21 but I can sftp:22 but I can access the old server perfectly with sftp on both 322 and 22.

1 Answer 1

0

This has been sorted.

The resolution is sftp module (mod_sftp.c) is not enabled by default. The modules can be found in /etc/proftpd/modules.conf, uncomment the mod_sftp section

sftp module

So I installed the proftpd-mod-crypto, proftpd-mod-ldap, and proftpd-mod-wrap.

2
  • Happy you sorted your problem out but please refrain posting text as images.
    – MC68020
    Commented Feb 27 at 23:19
  • Thank you @MC68020 Commented Feb 29 at 11:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .