如何使用lftp连接FTPS服务?
- By : Will
- Category : FTP & SFTP & FTPS
- Tags: ftps, lftp

FTP & SFTP & FTPS
1 基础知识
FTPS是一种对常用的文件传输协议(FTP)添加传输层安全(TLS)和安全套接层(SSL)加密协议支持的扩展协议
Linux中支持该协议的客户端很多,我们通常使用lftp来完成链接请求。
2 最佳实践
2.1 启动lftp客户端
lftp
可见如下提示,
lftp :~>
2.2 获取命令行帮助
lftp :~> help
可见如下提示,
!<shell-command> (commands) alias [<name> [<value>]] attach [PID] bookmark [SUBCMD] cache [SUBCMD] cat [-b] <files> cd <rdir> chmod [OPTS] mode file... close [-a] [re]cls [opts] [path/][pattern] debug [<level>|off] [-o <file>] du [options] <dirs> exit [<code>|bg] get [OPTS] <rfile> [-o <lfile>] glob [OPTS] <cmd> <args> help [<cmd>] history -w file|-r file|-c|-l [cnt] jobs [-v] [<job_no...>] kill all|<job_no> lcd <ldir> lftp [OPTS] <site> ln [-s] <file1> <file2> ls [<args>] mget [OPTS] <files> mirror [OPTS] [remote [local]] mkdir [-p] <dirs> module name [args] more <files> mput [OPTS] <files> mrm <files> mv <file1> <file2> [re]nlist [<args>] open [OPTS] <site> pget [OPTS] <rfile> [-o <lfile>] put [OPTS] <lfile> [-o <rfile>] pwd [-p] queue [OPTS] [<cmd>] quote <cmd> repeat [OPTS] [delay] [command] rm [-r] [-f] <files> rmdir [-f] <dirs> scache [<session_no>] set [OPT] [<var> [<val>]] site <site-cmd> source <file> torrent [-O <dir>] <file|URL>... user <user|URL> [<pass>] wait [<jobno>] zcat <files> zmore <files>
2.3 连接ftps服务器
lftp :~> open ftps.cmdschool.org
可见如下提示,
lftp ftps.cmdschool.org:~>
2.4 验证用户名和密码
lftp ftps.cmdschool.org:~> user user1 Password: ****** lftp ftps.cmdschool.org:~>
2.5 查看服务器的文件或目录
lftp ftps.cmdschool.org:~> ls
可见如下提示,
-rw-rw-r-- 1 1328 1663 3827697398 Jun 16 14:29 file.zip
另外,如果出现如下提示,
ls: Fatal error: Certificate verification: Not trusted
可预先使用以下命令禁用验证SSL证书然后再试,
set ssl:verify-certificate no
没有评论