Complete guide to go to hell and back. ยฉ @Lion ๐
Install google-drive-ocamlfuse on Debian Jessie and later.
Source: https://github.com/astrada/google-drive-ocamlfuse/wiki/How-to-install-from-source-on-Debian-Jessie
su
apt-get install software-properties-common sudo ssh
exitContinue with sudo:
sudo apt-get install opam ocaml make fuse camlp4-extra build-essential pkg-configCreate fuse group (if not already present):
sudo groupadd fuseDebian has a special user group to allow fuse access. Log out, and log back in after this to make change effective:
Replace
*username*with your real username
sudo usermod -a -G fuse *username*
sudo chown root:fuse /dev/fuse
sudo chmod 660 /dev/fuseopam init
opam update
opam install depext
eval `opam config env`
opam depext google-drive-ocamlfuse
opam install google-drive-ocamlfuse
. /home/*username*/.opam/opam-init/init.sh > /dev/null 2> /dev/null || trueYes, do it.
sudo rebootSource: https://github.com/astrada/google-drive-ocamlfuse/wiki/Headless-Usage-&-Authorization
- Sign in to your Google account and create a project: https://console.cloud.google.com/
- Click "API Manager" then "Library" in the left-hand pane (will take you to https://console.cloud.google.com/apis/library). Click on "Drive API", then "ENABLE API".
- Click "Credentials" in the left hand pane, then click on the button "Create Credentials" (OAuth client ID)
- Choose "Other"
- Choose any product name, e.g "My OCAMLDrive".
- Click "Create". You will get a Client ID, a Client Secret.
- Authorization: Back in your headless server, run google-drive-ocamlfuse for the first time. I used labels (in this document, I use the label "me") because I plan on using multiple accounts. However you can also run it without the -label parameter and it will use a default name for the label called "default". You will need the Client ID and secret you got from google above.
From version 0.5.3, you should use the -headless option:
Replace
*yourClientID*and*yourSecret*with your real credentials
google-drive-ocamlfuse -headless -label me -id *yourClientID*.apps.googleusercontent.com -secret *yourSecret* Example output:
Please, open the following URL in a web browser: https://accounts.google.com/o/oauth2/auth?client_id=##yourClientID##.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&response_type=code&access_type=offline&approval_prompt=force
Then, you should open the URL above in a graphical web browser, get the verification code from Google and put it here:
Please enter the verification code: That's it. You should be ready to mount.
Replace
*username*with your real username
mkdir /home/*username*/gdriveTry mount:
google-drive-ocamlfuse -label me /home/*username*/gdriveYou need mount script and service configuration
Source/tips: https://linuxconfig.org/how-to-automatically-execute-shell-script-at-startup-boot-on-systemd-linux
cd /user/local/bin
nano mount-gdrive.shType script content:
Replace
*username*with your real username
#!/bin/sh
su *username* -l -c "google-drive-ocamlfuse -label me /home/*username*/gdrive"Fix permission:
chmod 755 mount-gdrive.shGo to systemd directory:
cd /etc/systemd/system
nano gdrive.serviceType in file content:
[Unit]
After=networking.service
[Service]
ExecStart=/usr/local/bin/mount-gdrive.sh
[Install]
WantedBy=default.targetConfigure service:
chmod 664 /etc/systemd/system/gdrive.service
systemctl daemon-reload
systemctl enable gdrive.serviceTest your configuration:
systemctl start gdrive.serviceGG WP ๐ฎ ๐
๐ โ

Thanks you a lot for this manual!
It was little bit difficult for me (I'm new in Linux, my first week on Linux Debian :)) but I completed it successfully :D. I run this process on Debian 11 "Bullseye".
Also I found that steps at https://console.cloud.google.com/ was changed. Before creating credentials google required to create first OAuth project. During project configurations need to add your email to the testers users list, otherwise it will be not work.
Then you will be able to create new credentials. Also no more option "Other", I chose "Desktop" and it's worked for me.
That's all :)