FTP Server di Docker Container

From AbahDoku Wiki
Revision as of 12:41, 8 May 2025 by Akhyar (talk | contribs) (Created page with "= FTP Server (Cara 1) = Cara 1 ini menggunakan proftpd. Untuk menginstall proftpd diperlukan apache. docker run -dit --name my-apache-app -p 80:80 -p 21:21 -p 1100-1110:1100-1110 httpd:2.4 Jalankan container my-apache-app di dalam docker. docker exec -it my-apache-app /bin/bash Update dulu. apt-get update Install proftp. apt-get install proftpd Install edit nano. apt-get install nano Edit proftpd.conf nano /etc/proftpd/proftpd.conf bagian yang perlu di edit adalah...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

FTP Server (Cara 1)

Cara 1 ini menggunakan proftpd. Untuk menginstall proftpd diperlukan apache.

docker run -dit --name my-apache-app -p 80:80 -p 21:21 -p 1100-1110:1100-1110 httpd:2.4

Jalankan container my-apache-app di dalam docker.

docker exec -it my-apache-app /bin/bash

Update dulu.

apt-get update

Install proftp.

apt-get install proftpd

Install edit nano.

apt-get install nano

Edit proftpd.conf

nano /etc/proftpd/proftpd.conf

bagian yang perlu di edit adalah :

# DefaultRoot ~
DefaultRoot ~
# RequireValidShell off
RequireValidShell off
# PassivePorts 49152 65534
PassivePorts 1100 1110
# MasqueradeAddress 1.2.3.4
MasqueradeAddress 127.0.0.1

Cek status proftpd.

/etc/init.d/proftpd status

ProFTPD is started in standalone mode, currently not running.

Jalankan proftpd.

/etc/init.d/proftpd start
Starting ftp server: proftpd.

Cek kembali status proftpd.

/etc/init.d/proftpd status
ProFTPD is started in standalone mode, currently running.

Tambahkan user dan password.

useradd -d /home/ftpuser -s /sbin/nologin ftpuser

passwd ftpuser

New password: 
Retype new password:
passwd: password updated successfully

Buat folder sesuai user yang di buat.

mkdir /home/ftpuser

Cek atribut folder /home

ls -latr /home

total 12
drwxr-xr-x 1 root root 4096 May  8 09:31 ..
drwxr-xr-x 2 root root 4096 May  8 09:41 ftpuser
drwxr-xr-x 1 root root 4096 May  8 09:41 .

Sesuaikan atribut ftpuser dan .

chown -R ftpuser:ftpuser /home/ftpuser
chmod -R 755 /home/ftpuser

Restart proftpd

/etc/init.d/proftpd restart

Stopping ftp server: proftpd.
Starting ftp server: proftpd2025-05-08 09:49:10,107 6fcc50d55c57 proftpd[953] 6fcc50d55c57: 172.17.0.6:21 masquerading as 10.8.80.3

Saatnya menguji proftpd menggunakan FTP Client.