2

I tried to run an FTP server on my MacBook running High Sierra (Version 10.14.16)

But I couldn't. My steps are:

Setup FTP server on local by running pure-ftpd:

brew install pure-ftpd
brew services start pure-ftpd
sudo /usr/local/sbin/pure-ftpd

Setup fpt client to connect to fpt server on local:

brew install tnftp

Config pure-ftpd like this link: https://wiki.archlinux.org/index.php/Pure-FTPd (Update file /usr/local/etc/pure-ftpd.conf) contains:

Uncomment the following two lines:

NoAnonymous yes
PureDB /usr/local/etc/pureftpd.pdb

Set the option MinUID in /usr/local/etc/pure-ftpd.conf to 98 (I got it when run: sudo pure-pw show username) [UID : 98 (_ftp)]

List the shell of the FTP system user in /etc/shells: echo "/bin/false" >> /etc/shells (I appended '/bin/false' to end of this file manually) Make users (virtual or real user on my mac still not work):

mkdir ~/ftpuser/test3
sudo pure-pw useradd test3 -u ftp -D /Users/macbook/ftpuser/test3
sudo pure-pw mkdb

But when I tried to connect to the FTP server, the result was like this:

Macbooks-MacBook-Pro:marketing macbook$ ftp localhost
Trying ::1...
Connected to localhost.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 23:06. Server port: 21.
220 You will be disconnected after 15 minutes of inactivity.
Name (localhost:macbook): test3
331 User test3 OK. Password required
Password:
530 Login authentication failed
ftp: Login failed
ftp> quit
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.
Giacomo1968
  • 58,727

1 Answers1

0
brew install pure-ftpd
brew install inetutils
sudo brew services start pure-ftpd
su root

Update:

vi  /usr/local/etc/pure-ftpd.conf

Change:

NoAnonymous no 

To:

NoAnonymous yes

And uncomment:

PureDB /usr/local/etc/pureftpd.pdb

Save and exit.

I have created the /etc/pam.d/pure-ftpd following lines using root privilege:

# pure-ftpd: auth account password session
auth       required       pam_opendirectory.so
account    required       pam_permit.so
password   required       pam_deny.so
session    required       pam_permit.so

Save and exit, and exit root user.

mkdir /Users/you-username/ftpshare 
chmod 777 /Users/you-username/ftpshare

Create user and password to access ftp directory:

sudo pure-pw useradd userftp -u ftp -D /Users/you-username/ftpshare

Make db:

sudo pure-pw mkdb
sudo brew services restart pure-ftpd

Check:

ftp 127.0.0.1
Giacomo1968
  • 58,727
Gidalo
  • 1
  • 1