如何在不安装davfs2的情况下以编程方式在Ubuntu上安装WebDAV?

时间:2012-02-29 01:00:06

标签: ubuntu webdav gnome mount

我需要以编程方式在Ubuntu上安装WebDAV文件夹。我找到了一个使用davfs2的解决方案。

但是在Ubuntu上默认不安装davfs2。同时Gnome'Losplace-> Connect to Server ...'菜单可以在不安装davfs2的情况下执行此操作。我认为它也不需要root权限。

如何在不安装davfs2的情况下安装WebDAV的任何想法?

2 个答案:

答案 0 :(得分:1)

Ubuntu安装上已有一个命令行工具:nd。但这需要始终输入用户名和密码。

如果您可以从源代码构建像cadaver

这样的WebDAV客户端

您可以使用--prefix处的configure选项,然后选择您具有写入权限的文件夹:

./configure --prefix=/home/me/cadaver/
make
make install

cadaver支持自动登录需要通过.netrc文件进行身份验证的服务器

答案 1 :(得分:0)

Ubuntu有一个cadaver package可用于所有当前支持的版本,因此不需要编译。您可以使用命令sudo apt-get install cadaver进行安装。如JScoobyCed所述,“尸体支持自动登录需要通过.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.