Publish: 2018-05-18 | Modify: 2018-05-18
Rclone is a very powerful software that can mount cloud storage such as OneDrive, Google Drive, and Amazon Drive. It also supports all platforms, which means you can use it on Windows, Mac OS, and Linux. This article mainly shares the process of using Rclone to mount OneDrive on CentOS. The principles and methods for other systems or mounting other cloud drives are similar.
Most CentOS servers do not have a graphical interface, but Rclone requires a computer with a built-in browser to complete the authorization process. Therefore, the method used here is to install Rclone on a local Windows computer and obtain the authorized token, then copy it to the CentOS server.
rclone.exe
to the C:\Windows\System32
directory, so that you can use the rclone
command. See the screenshot below.rclone config
to start the configuration. Enter n
to create a new remote and give it a name, such as onedrive
. See the screenshot below.client_id
and client_secret
empty and press Enter. Then select the OneDrive version. For education or business version, choose b
; for personal version, choose p
.http://localhost:53682/
for authorization. If the authorization is successful, it will return a token
. Be sure to record and save the token
for later use.
Simply use the official one-click installation command. Enter the following command:
curl https://rclone.org/install.sh | sudo bash
The operation method is exactly the same as on Windows, so I won't repeat it. The only difference is to select n
for "Use auto config?" and enter the previously obtained token
.
Then enter the following command to mount:
# Install fuse
yum -y install fuse
# Create a mount directory
mkdir -p /home/onedrive
# Mount
rclone mount remote:path/to/files /home/onedrive
# If you need to keep it running in the background, use the following command
nohup rclone mount remote:path/to/files /home/onedrive &
Explanation of the parameters above:
remote
: the name of the remote, which we set as onedrive
before.path/to/files
: the remote file path (i.e., the Onedrive path), which can be set to /
./home/onedrive
: the local disk path.If everything goes well, you can see that Onedrive is successfully mounted by entering df -h
.
Rclone supports mounting more than 20 types of cloud drives, although most of them are foreign drives. It works better on foreign VPS for data backup and other purposes.
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.