ftp服务器的创建以及命令行使用

本文详细介绍如何在Ubuntu上搭建FTP服务器及SFTP服务器,包括配置过程与常见错误解决方法。提供两种替代连接方案,以及如何使用命令行进行文件下载。同时,针对SFTP服务器搭建过程中可能出现的问题给出解决方案。
  • 搭建ftp服务器,参考腾讯云的教程:

https://cloud.tencent.com/developer/labs/lab/10123

但是在后面连接的几种方法不能用,所有两个替代方案:

1)ftp ip 然后使用get和mget来获取remote端文件。

2)使用直接命令行方法:参考https://superuser.com/questions/532130/how-to-download-files-from-ftp-site-in-one-command-line-without-user-interaction

WGET ftp://ftp.mydomain.com/path/file.ext  
//for anonymous downloads
//or:
WGET ftp://user:password@ftp.mydomain.com/path/file.ext  
//when authentication is required.

2、出现错误的原因之一:

421 Service not available, remote server has closed connection
Login failed.
No control connection for command: 传输端点尚未连接

上述错误在本人的一台虚拟机里面出现,在另一台云服务器里面没有这个错误。具体原因未知。

 

  •  SFTP服务器的搭建:

方法参考如下链接:

https://askubuntu.com/questions/420652/how-to-setup-a-restricted-sftp-server-on-ubuntu#607898

如果出现下面错误:

Job for ssh.service failed because the control process exited with error code. see systemctl status ssh.service and journalctl -xe for details.

请参考链接:

https://askubuntu.com/questions/867967/ssh-server-fail

主要通过如下指令排查:

sudo /usr/sbin/sshd -T

Update the article at Dec. 22, 2020:

A great and success method is in https://www.cnblogs.com/whatmiss/p/7068772.html

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值