尸体自动login(WebDav客户端)

我最近一直在使用尸体,但有没有办法自动login,例如一个class轮:

尸体http://webdav.server.com user = xxxxxxxxx pass = xxxxxxxxxxx

我不能使用davfs2,因为我的VPS不会安装WebDav,因为它符合FUSE。

您可以使用.netrc文件,但请注意这是一个安全风险。 它包含没有encryption的dav帐户的密码。 您需要使用的一些预防措施是:

  1. 不要在其他地方使用密码。
  2. 设置.netrc文件权限400或600,并由运行尸体的用户拥有。 使用
  3. 如果可能的话尸体程序作为自己的用户运行,只运行脚本。

这里是来自尸体手册页的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 hostname 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 hostname. 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. 

祝你好运,Rik