ftpクライアントから、ユーザ名test1、パスワードtest1でアクセスします。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "ub1604pureftpd"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1604pureftpd"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.105", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.105", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
# update packages
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
apt-get -y install pure-ftpd
groupadd ftpgroup
useradd -g ftpgroup -d /dev/null -s /etc ftpuser
sudo mkdir /home/ftpusers
sudo mkdir /home/ftpusers/test1
PASSWORD=test1
( echo ${PASSWORD} ; echo ${PASSWORD} ) | pure-pw useradd test1 -u ftpuser -d /home/ftpusers/test1 > /dev/null 2>&1
pure-pw mkdb
ln -s /etc/pure-ftpd/pureftpd.passwd /etc/pureftpd.passwd
ln -s /etc/pure-ftpd/pureftpd.pdb /etc/pureftpd.pdb
ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/PureDB
sudo chown -hR ftpuser:ftpgroup /home/ftpusers/
gksudo pureadmin
sudo /etc/init.d/pure-ftpd restart
SHELL
end
0 件のコメント:
コメントを投稿