我需要以编程方式在Ubuntu上挂载WebDAV文件夹。我找到了一个使用davfs2的解决方案。
但是,默认情况下,davfs2不会安装在Ubuntu上。同时Gnome 'Places->Connect to Server...‘菜单可以在不安装davfs2的情况下执行此操作。我假设它也不需要root权限。
你知道如何在不安装davfs2的情况下挂载WebDAV吗?
发布于 2012-02-29 09:10:35
在Ubuntu安装中已经有一个命令行工具:nd。但这需要一直输入用户名和密码。
如果您可以从源代码构建一个像cadaver这样WebDAV客户端
您可以在configure中使用--prefix选项,并选择您具有写访问权限的文件夹:
./configure --prefix=/home/me/cadaver/
make
make installcadaver支持通过.netrc文件自动登录到需要身份验证的服务器
发布于 2017-03-13 23:15:41
Ubuntu有一个可用于所有当前支持的版本的cadaver package,所以不需要编译。您可以使用JScoobyCed提到的命令sudo apt-get install cadaver安装它:"cadaver支持通过.netrc文件自动登录到需要身份验证的服务器“。
以下是手册页的几个摘录:
THE .netrc FILE
The file ~/.netrc may be used to automatically login to a server
requiring authentication. The following tokens (separated by spaces,
tabs or newlines) may be used:
machine host
Identify a remote machine host which is compared with the host‐
name given on the command line or as an argument to the open
command. Any subsequent tokens up to the end of file or the
next machine or default token are associated with this entry.
default
This is equivalent to the machine token but matches any host‐
name. Only one default token may be used and it must be after
all machine tokens.
login username
Specifies the username to use when logging in to the remote
machine.
password string
passwd string
Specifies the password to use when logging in to the remote
machine.
Any other tokens (as described in ftp(1)) are ignored.
EXAMPLES
cadaver http://dav.example.com/
Connects to the server myserver.example.com, opening the root collection.
cadaver http://zope.example.com:8022/Users/fred/
Connects to the server zope.example.com using port 8022, opening the collection "/Users/fred/".
cadaver https://secure.example.com/
Connects to a server called secure.example.com using SSL.
FILES
~/.cadaverrc
Individual user settings that can override cadaver defaults and to script cadaver. Can be changed by the "--rcfile" option.
~/.netrc
Login and initialization information used by the auto-login process. See section "THE .netrc FILE" for details.https://stackoverflow.com/questions/9492179
复制相似问题