Difference between revisions of "CurlFtpFS (简体中文)"

From ArchWiki
Jump to: navigation, search
(update interlanguage links (https://github.com/lahwaacz/wiki-scripts/blob/master/update-interlanguage-links.py))
(Update translation.)
 
Line 3: Line 3:
 
[[en:CurlFtpFS]]
 
[[en:CurlFtpFS]]
 
[[ja:CurlFtpFS]]
 
[[ja:CurlFtpFS]]
{{Expansion}}
+
{{Note|As of February 2015, curlftpfs is reported to be extremely slow, see for example [https://bugs.launchpad.net/ubuntu/+source/curlftpfs/+bug/1267749 a Ubuntu bug report] and a [http://stackoverflow.com/questions/24360479/ftp-with-curlftpfs-is-extremely-slow-to-the-point-it-is-impossible-to-work-with stackoverflow.com question].}}
  
 +
[http://curlftpfs.sourceforge.net/ CurlFtpFS] is a filesystem for accessing FTP hosts based on [[FUSE]] and libcurl.
  
== Packages ==
+
== 安装 ==
有不少软件可以挂载FTP,你可以将FTP挂载到某个目录下,然后就像本地文件系统一样操作。
 
  
* curlftpfs [推荐]
+
[[Install|安装]] 软件包 {{Pkg|curlftpfs}}。
* fuseftp
 
* lufs [过时了]
 
  
这三个都是基于FUSE库。
+
有必要的话,加载fuse内核模块
 
+
# modprobe fuse
=== curlftpfs ===
 
  
安装
+
== Mount FTP folder as root ==
# pacman -S curlftpfs
 
  
有必要的话,加载fuse内核模块
+
Create the mount point and then mount the FTP folder.
# modprobe fuse
 
有必要的话,创建一个挂载点。
 
 
  # mkdir /mnt/ftp
 
  # mkdir /mnt/ftp
 
  # curlftpfs ftp.yourserver.com /mnt/ftp/ -o user=username:password
 
  # curlftpfs ftp.yourserver.com /mnt/ftp/ -o user=username:password
如果你想让其他用户访问,用以下命令。
+
If you want to give other (regular) users access right, use the {{ic|allow_other}} option:
 
  # curlftpfs ftp.yourserver.com /mnt/ftp/ -o user=username:password,allow_other
 
  # curlftpfs ftp.yourserver.com /mnt/ftp/ -o user=username:password,allow_other
不要添加额外的空格或逗号,否则 ''allow_other'' 参数可能无法被程序识别.
+
Do not add space after the comma or the {{ic|allow_other}} argument will not be recognized.
  
如果要使用FTP的 active mode 挂载,请添加 'ftp_port=-':
+
To use FTP in active mode add the option 'ftp_port=-':
 
  # curlftpfs ftp.yourserver.com /mnt/ftp/ -o user=username:password,allow_other,ftp_port=-
 
  # curlftpfs ftp.yourserver.com /mnt/ftp/ -o user=username:password,allow_other,ftp_port=-
  
你也可以把这一行加入 /etc/fstab 来自动在开机时后挂载。
+
You can add this line to /etc/fstab to mount automatically.
  curlftpfs#USER:PASSWORD@ftp.domain.org /mnt/mydomainorg fuse auto,user,uid=1000,allow_other 0 0
+
  curlftpfs#USER:PASSWORD@ftp.domain.org /mnt/mydomainorg fuse auto,user,uid=1000,allow_other,_netdev 0 0
 +
 
 +
{{Tip|1=You can use codepage="''string''" when having problems with non-US English characters on servers that do not support UTF8, e.g. codepage="iso8859-1"}}
 +
 
 +
To prevent the password to be shown in the process list, create a {{ic|.netrc}} file in the home directory of the user running curlftpfs and {{ic|chmod 600}} with the following content:
 +
 
 +
machine ftp.yourserver.com
 +
login username
 +
password mypassword
 +
 
 +
== Mount FTP folder as normal user ==
 +
 
 +
You can also mount as normal user (always use the {{ic|.netrc}} file for the credentials and ssl encryption!):
 +
$ mkdir ~/my-server
 +
<nowiki>$ curlftpfs -o ssl,utf8 ftp://my-server.tld/ ~/my-server</nowiki>
 +
if the answer is
 +
Error connecting to ftp: QUOT command failed with 500
 +
then the server does not support the {{ic|utf8}} option. Leave it out and all will be fine.
 +
{{Tip|1=If need be try setting the encoding with for example -o codepage="iso8859-1"}}
 +
 
 +
To unmount:
 +
$ fusermount -u ~/my-server
 +
 
 +
== Connect to encrypted server==
 +
In it's default settings, CurlFtpFS will authenticate in cleartext when connecting to a non encrypted connection port. If the remote server is configured to refuse non encrypted authentification method / force encrypted authentification, CurlFtpFS will return a
 +
# Error connecting to ftp: Access denied: 530
 +
 
 +
To authenticate to the ftp server using explicit encrypted authentification, you must specify the ssl or tsl option.
 +
# curlftpfs ftp.yourserver.com /mnt/ftp/ -o ssl,user=username:password
  
译者注,似乎这样用也是可以到。
+
If your server uses a self-generated certificate not thrusted by your computer, you can specify to ignore it
 +
# curlftpfs ftp.yourserver.com /mnt/ftp/ -o ssl,no_verify_peer,no_verify_hostname,user=username:password
  
sudo curlftpfs -o rw,allow_other ftp://username:password@ftp.yourserver.com /mnt/ftp
+
An implicit tsl mode is also available. For more details, check the manual page.
  
 +
== 乱码 ==
 
如果中文出现乱码,你可能需要指定编码:
 
如果中文出现乱码,你可能需要指定编码:
  
 
  sudo curlftpfs -o codepage=gbk -o rw,allow_other ftp://username:password@ftp.yourserver.com /mnt/ftp
 
  sudo curlftpfs -o codepage=gbk -o rw,allow_other ftp://username:password@ftp.yourserver.com /mnt/ftp

Latest revision as of 00:14, 30 June 2018

Note: As of February 2015, curlftpfs is reported to be extremely slow, see for example a Ubuntu bug report and a stackoverflow.com question.

CurlFtpFS is a filesystem for accessing FTP hosts based on FUSE and libcurl.

安装

安装 软件包 curlftpfs

有必要的话,加载fuse内核模块

# modprobe fuse

Mount FTP folder as root

Create the mount point and then mount the FTP folder.

# mkdir /mnt/ftp
# curlftpfs ftp.yourserver.com /mnt/ftp/ -o user=username:password

If you want to give other (regular) users access right, use the allow_other option:

# curlftpfs ftp.yourserver.com /mnt/ftp/ -o user=username:password,allow_other

Do not add space after the comma or the allow_other argument will not be recognized.

To use FTP in active mode add the option 'ftp_port=-':

# curlftpfs ftp.yourserver.com /mnt/ftp/ -o user=username:password,allow_other,ftp_port=-

You can add this line to /etc/fstab to mount automatically.

curlftpfs#USER:PASSWORD@ftp.domain.org /mnt/mydomainorg fuse auto,user,uid=1000,allow_other,_netdev 0 0
Tip: You can use codepage="string" when having problems with non-US English characters on servers that do not support UTF8, e.g. codepage="iso8859-1"

To prevent the password to be shown in the process list, create a .netrc file in the home directory of the user running curlftpfs and chmod 600 with the following content:

machine ftp.yourserver.com
login username
password mypassword

Mount FTP folder as normal user

You can also mount as normal user (always use the .netrc file for the credentials and ssl encryption!):

$ mkdir ~/my-server
$ curlftpfs -o ssl,utf8 ftp://my-server.tld/ ~/my-server

if the answer is

Error connecting to ftp: QUOT command failed with 500

then the server does not support the utf8 option. Leave it out and all will be fine.

Tip: If need be try setting the encoding with for example -o codepage="iso8859-1"

To unmount:

$ fusermount -u ~/my-server

Connect to encrypted server

In it's default settings, CurlFtpFS will authenticate in cleartext when connecting to a non encrypted connection port. If the remote server is configured to refuse non encrypted authentification method / force encrypted authentification, CurlFtpFS will return a

# Error connecting to ftp: Access denied: 530

To authenticate to the ftp server using explicit encrypted authentification, you must specify the ssl or tsl option.

# curlftpfs ftp.yourserver.com /mnt/ftp/ -o ssl,user=username:password

If your server uses a self-generated certificate not thrusted by your computer, you can specify to ignore it

# curlftpfs ftp.yourserver.com /mnt/ftp/ -o ssl,no_verify_peer,no_verify_hostname,user=username:password

An implicit tsl mode is also available. For more details, check the manual page.

乱码

如果中文出现乱码,你可能需要指定编码:

sudo curlftpfs -o codepage=gbk -o rw,allow_other ftp://username:password@ftp.yourserver.com /mnt/ftp