暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

使用rclone挂载GoogleDrive到kali本地

Torrk 2020-11-10
459

#0x00 环境准备


有一个能够访问Google的代理,这里以v2ray为例


#0x01 安装rclone

apt install rclone

#0x02 设置http代理


编辑kali上相应的配置文件 /usr/local/etc/v2ray/config.json


// 同时实现了http和socks5
{
"policy": null,
"log": {
"access": "",
"error": "",
"loglevel": "warning"
},
"inbounds": [
{
"tag": "socksProxy",
"port": 10806,
"listen": "127.0.0.1",
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
},
"settings": {
"auth": "noauth",
"udp": true,
"ip": null,
"address": null,
"clients": null
},
"streamSettings": null
},
{
"tag": "httpProxy",
"port": 10801,
"listen": "127.0.0.1",
"protocol": "http",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
},
"settings": {
"auth": "password",
"accounts": [{
"user": "username",
"pass": "password"
}],
"udp": true,
"ip": null,
"address": null,
"clients": null
},
"streamSettings": null
}
],
"outbounds": [
{
"tag": "socksProxy",
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "iplc.jijifun.com",
"port": 18080,
"users": [
{
"id": "d28027c3-08aa-4d84-a59d-78ead799830c",
"alterId": 2,
"email": "t@t.tt",
"security": "auto"
}
]
}
],
"servers": null,
"response": null
},
"streamSettings": {
"network": "ws",
"security": null,
"tlsSettings": null,
"tcpSettings": null,
"kcpSettings": null,
"wsSettings": {
"connectionReuse": true,
"path": "/ray",
"headers": {
"Host": "hinet.paasmi.com"
}
},
"httpSettings": null,
"quicSettings": null
},
"mux": {
"enabled": true,
"concurrency": 8
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {
"vnext": null,
"servers": null,
"response": null
},
"streamSettings": null,
"mux": null
},
{
"tag": "block",
"protocol": "blackhole",
"settings": {
"vnext": null,
"servers": null,
"response": {
"type": "http"
}
},
"streamSettings": null,
"mux": null
}
],
"stats": null,
"api": null,
"dns": null,
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"port": null,
"inboundTag": [
"api"
],
"outboundTag": "api",
"ip": null,
"domain": null
}
]
}
}

#0x03 命令行挂载(仅第一次测试用)

# 设置命令行代理(仅对当前窗口有效),对系统影响最小
# 有密码时:http_proxy=http://userName:password@proxyAddress:port
export http_proxy=http://127.0.0.1:1080


# 挂载命令
# 详细可参考:https://nico.cc/archives/70/
rclone mount GoogleDrive:/ /home/GoogleDrive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000

#0x03 开机自动挂载

touch /usr/lib/systemd/system/rclone-mount.service
vim /usr/lib/systemd/system/rclone-mount.service

内容如下

[Unit]
Description=rclone


[Service]
Environment="http_proxy=http://127.0.0.1:10801"
Environment="https_proxy=http://127.0.0.1:10801"
Environment='REMOTE_PATH=GoogleDrive:/'
#GoogleDrive:/ 表示 name:云盘文件夹路径,斜杠 / 表示将整个云盘挂载到本地,注意冒号


Environment='LOCAL_PATH=/home/GoogleDrive/'
#挂载到服务器本地的路径


Type=simple
User=root
ExecStart=rclone mount ${REMOTE_PATH} ${LOCAL_PATH} --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000
ExecStop=fusermount -qzu ${LOCAL_PATH}
Restart=on-failure


[Install]
WantedBy=multi-user.target

启动并设置开机自启

systemctl enable rclone-mount.service
systemctl start rclone-mount.service
文章转载自Torrk,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论