使用KeePass保存密码,在个人服务器上安装WebDav协议。
# nginx nginx-extras apache2-utils
sudo aptitude install nginx nginx-extras apache2-utils
# 创建Webdav根目录
mkdir -p /var/www/webdav/
# 添加配置
cat << 'EOF' | sudo tee /etc/nginx/conf.d/webdav.conf
server {
listen 8081;
server_name your_domain;
root /var/www/webdav/;
client_body_temp_path /var/www/webdav/tmp;
access_log /var/log/nginx/webdav_access.log;
error_log /var/log/nginx/webdav_error.log;
location / {
auth_basic "Not currently available";
auth_basic_user_file /etc/nginx/conf.d/.htpasswd;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
create_full_put_path on;
dav_access user:rw group:r;
autoindex on;
}
}
EOF
# 创建webdav密码验证
sudo htpasswd -c /etc/nginx/conf.d/.htpasswd pi
# nginx重新读取配置
sudo nginx -s reload
# 访问,输入账号密码即可
http://IP或domain:8081/
# 如不能访问,请检查防火墙