Configuring a firewall and pureftpd with external access

I am trying to configure a Vagrant VM (Ubuntu Lucid64) using pureftpd which I want to get from the host machine.

Vagrant::Config.run do |config| config.vm.define :my_vm do |conf| conf.vm.host_name = "my_vm" conf.vm.network :hostonly, "192.168.187.2" conf.vm.forward_port 22, 18722 conf.vm.forward_port 21, 2121 conf.vm.forward_port 22, 2122 conf.vm.customize [ "modifyvm", :id, "--name", "my vm" ] conf.vm.box = "lucid64" conf.vm.boot_mode = :gui conf.ssh.max_tries = 150 # Share the project root with the vagrant VMs conf.vm.share_folder("v-root", "/vagrant", File.expand_path(File.dirname(__FILE__))) # Set up passwordless ssh for root conf.vm.provision :shell, :inline => "sudo mkdir -p /root/.ssh && sudo cat /home/vagrant/.ssh/authorized_keys >> /root/.ssh/authorized_keys" end # The url from where the 'config.vm.box' box will be fetched if it # doesn't already exist on the user system. config.vm.box_url = "http://files.vagrantup.com/lucid64.box" end 

What I have so far is a working firewall running in pureftpd, and I can open an FTP connection. However, I cannot upload the file via FTP because I get the following error:

 TYPE A 200 TYPE is now ASCII PASV 227 Entering Passive Mode (10,0,2,15,156,170) [Replacing site local address 10.0.2.15 with 127.0.0.1] TYPE I 200 TYPE is now 8-bit binary PASV 227 Entering Passive Mode (10,0,2,15,156,96) [Replacing site local address 10.0.2.15 with 127.0.0.1] NOOP 200 Zzz... SITE CHMOD 644 /one/two_days_initial.xml 550 Could not change perms on /one/two_days_initial.xml QUIT 221-Goodbye. You uploaded 0 and downloaded 0 kbytes. 221 Logout. 

After reading a little about FTP, I understand that I need to forward 2 ports in order to allow the ftp session to transfer data, but my attempt (in my stray file) does not work.

I double checked that the user of the FTP user in DOES has read / write permissions to the directory where I am trying to upload the file, but I still get the specified error.

Has anyone set up a tramp and an FTP server (pureftp or another) so that it can accept FTP connections?

+6
source share

Source: https://habr.com/ru/post/949872/


All Articles