Hướng dẫn cấu hình Rclone kết nối qua tài khoản FTP

30/12/2020

bài trước, chúng ta đã cài tìm hiểu cách cấu hình rclone kết nối với Google Drive.

Bài viết này sẽ giới thiệu với các bạn cách cấu hình rclone kết nối với tài khoản FTP.

Nếu chưa cài đặt rclone, các bạn tham khảo bài viết hướng dẫn cài đặt rclone nhé.

Để bắt đầu, sử dụng lệnh:

rclone config

Nhập n (New Remote) để tạo mới một kết nối.

Tại dòng name, nhập tên kết nối của bạn, trong ví dụ này tôi sử dụng tên kết nối là ftp

Sau đó nhập 11 để chọn kết nối FTP Connection.

Chương trình yêu cầu nhập các thông số:

  • host: là địa chỉ IP hoặc domain của FTP server.
  • user: tên tài khoản ftp
  • port: port của giao thức ftp, nếu để trống sẽ sử dụng port mặc định 21.
  • password:
    • nhập y (Yes type in my own password): để tự nhập password của mình.
    • nhập g (Generate random password): để tạo password ngẫu nhiên.

Trong ví dụ này tôi đã chuẩn bị trước tài khoản FTP trên máy chủ FTP do vậy tôi sẽ chọn y để nhập mật khẩu của mình. Nhập mật khẩu 2 lần để xác nhận mật khẩu là chính xác.

Tại 2 dòng Use FTPS over TLS (Implicit) và Use FTP over TLS (Explicit) bỏ trống bằng cách Enter để chọn giá trị mặc định false.

Chương trình tiếp tục hỏi có muốn chỉnh sửa cấu hình nâng cao (Edit advanced config?), nhập n

Cuối cùng, nhập y để xác nhận các thông tin vừa thiết lập (Yes this is OK)

Output của quá trình cài đặt như sau:

phuongdm@Phuongdm-PC:~$ rclone config  Current remotes:  Name                 Type ====                 ==== ggdrive              drive  e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config e/n/d/r/c/s/q> n name> ftp Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value  1 / 1Fichier     "fichier"  2 / Alias for an existing remote     "alias"  3 / Amazon Drive     "amazon cloud drive"  4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, Tencent COS, etc)     "s3"  5 / Backblaze B2     "b2"  6 / Box     "box"  7 / Cache a remote     "cache"  8 / Citrix Sharefile     "sharefile"  9 / Dropbox     "dropbox" 10 / Encrypt/Decrypt a remote     "crypt" 11 / FTP Connection     "ftp" 12 / Google Cloud Storage (this is not Google Drive)     "google cloud storage" 13 / Google Drive     "drive" 14 / Google Photos     "google photos" 15 / Hubic     "hubic" 16 / In memory object storage system.     "memory" 17 / Jottacloud     "jottacloud" 18 / Koofr     "koofr" 19 / Local Disk     "local" 20 / Mail.ru Cloud     "mailru" 21 / Mega     "mega" 22 / Microsoft Azure Blob Storage     "azureblob" 23 / Microsoft OneDrive     "onedrive" 24 / OpenDrive     "opendrive" 25 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)     "swift" 26 / Pcloud     "pcloud" 27 / Put.io     "putio" 28 / QingCloud Object Storage     "qingstor" 29 / SSH/SFTP Connection     "sftp" 30 / Sugarsync     "sugarsync" 31 / Tardigrade Decentralized Cloud Storage     "tardigrade" 32 / Transparently chunk/split large files     "chunker" 33 / Union merges the contents of several upstream fs     "union" 34 / Webdav     "webdav" 35 / Yandex Disk     "yandex" 36 / http Connection     "http" 37 / premiumize.me     "premiumizeme" 38 / seafile     "seafile" Storage> 11 ** See help for ftp backend at: https://rclone.org/ftp/ **  FTP host to connect to Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value  1 / Connect to ftp.example.com     "ftp.example.com" host> <hostname of ftp server> FTP username, leave blank for current username, phuongdm Enter a string value. Press Enter for the default (""). user> phuongdm FTP port, leave blank to use default (21) Enter a string value. Press Enter for the default (""). port> 21 FTP password y) Yes type in my own password g) Generate random password y/g> y      Enter the password: password: Confirm the password: password: Use FTPS over TLS (Implicit) When using implicit FTP over TLS the client will connect using TLS right from the start, which in turn breaks the compatibility with non-TLS-aware servers. This is usually served over port 990 rather than port 21. Cannot be used in combination with explicit FTP. Enter a boolean value (true or false). Press Enter for the default ("false"). tls>  Use FTP over TLS (Explicit) When using explicit FTP over TLS the client explicitly request security from the server in order to upgrade a plain text connection to an encrypted one. Cannot be used in combination with implicit FTP. Enter a boolean value (true or false). Press Enter for the default ("false"). explicit_tls>  Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config -------------------- [ftp] type = ftp host = <ftp server> user = phuongdm port = 21 pass = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y Current remotes:  Name                 Type ====                 ==== ftp                  ftp ggdrive              drive  e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config e/n/d/r/c/s/q> q

Như vậy là chúng ta đã thiết lập cấu hình tài khoản ftp thành công sử dụng rclone.

Kiểm tra hoạt động của rclone bằng cách copy file từ server đến ftp server:

phuongdm@Phuongdm-PC:~$ rclone ls ftp: phuongdm@Phuongdm-PC:~$ rclone copy Downloads/backup.png ftp: phuongdm@Phuongdm-PC:~$ rclone ls ftp:     25834 backup.png

Sau đó truy cập ftp server và liệt kê file tồn tại:

phuongdm@Phuongdm-PC:~$ sudo ftp -n -i <hostname_ftp_server> 21 Connected to <hostname_ftp_server> 220-FileZilla Server 0.9.60 beta 220-written by Tim Kosse ([email protected]) 220 Please visit https://filezilla-project.org/ ftp> user (username) phuongdm 331 Password required for phuongdm Password:  230 Logged on Remote system type is UNIX. ftp> passive Passive mode on. ftp> ls 227 Entering Passive Mode (103,28,36,84,19,191) 150 Opening data channel for directory listing of "/" -rw-r--r-- 1 ftp ftp          25834 Oct 28 09:24 backup.png 226 Successfully transferred "/" ftp> exit 221 Goodbye

Theo dõi bài viết tiếp theo để tìm hiểu cách cấu hình kết nối rclone với Dropbox, và Amazone S3 nhé.

Một số bài viết liên quan:

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Hướng dẫn cài đặt WordOps trên Ubuntu 18.04

WordOps là 1 chương trình chạy trên dòng lệnh giúp dễ dàng cài đặt nhanh LEMP stack, dễ dang quản...
30/12/2020

Check for and Patch Spectre and Meltdown on CentOS7

How to Check for and Patch Spectre and Meltdown Vulnerability on CentOS7 Spectre and Meltdown Vulnerabilities of Intel...
28/12/2020

How to fix “network ‘default’ is not active” error in libvirt

Question: When I am trying to start a guest VM on QEMU/KVM via virt-manager, it fails to start with the error: "Error starting...
01/01/2021
Bài Viết

Bài Viết Mới Cập Nhật

SỰ KHÁC BIỆT GIỮA RESIDENTIAL PROXY VÀ PROXY DATACENTER
17/02/2024

Mua Proxy v6 US Private chạy PRE, Face, Insta, Gmail
07/01/2024

Mua shadowsocks và hướng dẫn sữ dụng trên window
05/01/2024

Tại sao Proxy Socks lại được ưa chuộng hơn Proxy HTTP?
04/01/2024

Mua thuê proxy v4 nuôi zalo chất lượng cao, kinh nghiệm tránh quét tài khoản zalo
02/01/2024