将你的 Google Drive 连接到 Fedora 工作站
Google 云存储
![](/data/attachment/album/202003/25/215714veayepxpex2qfpa2.jpg)


有大量的云服务可用于存储重要文档。Google Drive 无疑是最受欢迎的之一。它提供了一组相应的应用程序，例如文档，表格和幻灯片来创建内容。但是，你也可以在 Google Drive 中存储任意内容。本文向你展示如何将其连接到 [Fedora 工作站](https://getfedora.org/workstation)。


### 添加帐户


Fedora 工作站可在安装后首次启动或者之后的任何时候添加一个帐户。要在首次启动期间添加帐户，请按照提示进行操作。其中包括选择添加一个帐户：


![](/data/attachment/album/202003/25/215714qzfhjfvufjq665zu.jpg)


选择 Google，然后会出现一个登录提示，请使用你的 Google 帐户信息登录。


![](/data/attachment/album/202003/25/215715ziz48rbdmqtzyaa7.jpg)


请注意，此信息仅传输给 Google，而不传输给 GNOME 项目。下一个页面要求你授予访问权限，这是必需的，以便系统桌面可以与 Google 进行交互。向下滚动查看访问请求，然后选择“允许”继续。


你会在移动设备和 Gmail 中收到有关新设备（系统）访问 Google 帐户的通知。这是正常现象。


![](/data/attachment/album/202003/25/215716cks6zh1czhccttpu.jpg)


如果你在初次启动时没有执行此操作，或者需要重新添加帐户，请打开“设置”，然后选择“在线账户”来添加帐户。可以通过顶部栏右侧的下拉菜单（“齿轮”图标）或打开“概览”并输入“settings”来使用它。接着和上面一样。


### 在 Google Drive 中使用“文件”应用


打开“文件”应用（以前称为 “nautilus”）。“文件”应用可以通过左侧栏访问。在列表中找到你的 Google 帐户。


当你选择帐户后，“文件”应用会显示你的 Google Drive 的内容。你可以使用 Fedora 工作站的本地应用打开某些文件，例如声音文件或 [LibreOffice](https://fedoramagazine.org/discover-hidden-gems-libreoffice/) 兼容文件（包括 Microsoft Office 文档）。其他文件（例如 Google 文档、表格和幻灯片等 Google 应用文件）将使用浏览器和相应的应用打开。


请记住，如果文件很大，将需要一些时间才能通过网络接收文件，你才可以打开它。


你还可以复制粘贴 Google Drive 中的文件到连接到 Fedora 工作站的其他存储，或者反之。你还可以使用内置功能来重命名文件、创建文件夹并组织它们。对于共享和其他高级选项，请和平常一样在浏览器中使用 Google Drive。


请注意，“文件”应用程序不会实时刷新内容。如果你从其他连接 Google 的设备（例如手机或平板电脑）添加或删除文件，那么可能需要按 `Ctrl+R` 刷新“文件”应用。




---


via: <https://fedoramagazine.org/connect-your-google-drive-to-fedora-workstation/>


作者：[Paul W. Frields](https://fedoramagazine.org/author/pfrields/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
There are plenty of cloud services available where you can store important documents. Google Drive is undoubtedly one of the most popular. It offers a matching set of applications like Docs, Sheets, and Slides to create content. But you can also store arbitrary content in your Google Drive. This article shows you how to connect it to your [Fedora Workstation](https://getfedora.org/workstation).

## Adding an account

Fedora Workstation lets you add an account either after installation during first startup, or at any time afterward. To add your account during first startup, follow the prompts. Among them is a choice of accounts you can add:

![Online account listing](https://fedoramagazine.org/wp-content/uploads/2020/03/firstboot-choices.jpg)

Select Google and a login prompt appears for you to login, so use your Google account information.

![Online account login dialog](https://fedoramagazine.org/wp-content/uploads/2020/03/firstboot-signin.jpg)

Be aware this information is only transmitted to Google, not to the GNOME project. The next screen asks you to grant access, which is required so your system’s desktop can interact with Google. Scroll down to review the access requests, and choose *Allow* to proceed.

You can expect to receive notifications on mobile devices and Gmail that a new device — your system — accessed your Google account. This is normal and expected.

![Online account access request dialog](https://fedoramagazine.org/wp-content/uploads/2020/03/firstboot-grantaccess.jpg)

If you didn’t do this at first startup, or you need to re-add your account, open the *Settings* tool, and select *Online Accounts* to add the account. The *Settings* tool is available through the dropdown at right side of the Top Bar (the “gear” icon), or by opening the Overview and typing *settings*. Then proceed as described above.

## Using the Files app with Google Drive

Open the *Files* app (formerly known as *nautilus*). Locations the Files app can access appear on the left side. Locate your Google account in the list.

When you select this account, the Files app shows the contents of your Google drive. Some files can be opened using your Fedora Workstation local apps, such as sound files or [LibreOffice](https://fedoramagazine.org/discover-hidden-gems-libreoffice/)-compatible files (including Microsoft Office docs). Other files, such as Google app files like Docs, Sheets, and Slides, open using your web browser and the corresponding app.

Remember that if the file is large, it will take some time to receive over the network so you can open it.

You can also copy and paste files in your Google Drive storage from or to other storage connected to your Fedora Workstation. You can also use the built in functions to rename files, create folders, and organize them. For sharing and other advanced options, use Drive from your browser per normal.

Be aware that the Files app does not refresh contents in real time. If you add or remove files from other Google connected devices like your mobile phone or tablet, you may need to hit **Ctrl+R** to refresh the Files app view.

*Photo by Beatriz Pérez Moya on Unsplash.*

## Vernon Van Steenkist

So, is this a VFS feature of the GNOME File manager or is your Google Drive actually being mounted? This technical detail would have been helpful, especially for people like me who do not use GNOME. If your Google Drive is not actually being mounted to a mount point, google-drive-ocamlfuse is a much better choice since your Google Drive is actually being mounted via FUSE which means you can access all you Google Drive files with any application – including command line.

https://github.com/astrada/google-drive-ocamlfuse

## Paul W. Frields

The mount is performed via GVFS and can also be found via

/run/user/$UID/gvfs/. This article is written for the audience of Fedora Workstation users, for whom GNOME is provided.## Frank L

Are you sure? When I tried to use a terminal window to access /user/$UID/ I didn’t find anything.

## Paul W. Frields

Yes, I’m sure. It’s /run/user/$UID/gvfs as stated earlier.

## Roland Müller

I am using XFCE as DE and find it a bit strange that the article did not even bother to mention that its content is Gnome-only. Linux is for many a matter of having a choice.

## Paul W. Frields

It’s not strange at all; the article title itself specifically says “Fedora Workstation,” which uses the GNOME desktop environment.

## Roland Müller

https://en.wikipedia.org/wiki/Fedora_(operating_system)#Editions

“Fedora Workstation – It targets users who want a reliable, user-friendly, and powerful operating system for their laptop or desktop computer. It comes with GNOME by default but other desktops can be installed or can be directly installed as Spins.”

## Paul W. Frields

Wikipedia doesn’t speak for the Fedora Workstation group and their intent to have a cohesive, modern desktop environment. Also, when the Magazine produces articles for Workstation, they’re intended to feature the edition as it ships out of the box, not altered with other window managers or environments. Articles for other environments will be so titled. Thanks for writing, let’s move on. 🙂

## K. de Jong

It’s nice indeed! However, it doesn’t work when using 2FA exclusively with e.g. a Yubikey. For that Chrome/Chromium is needed.

## Paul W. Frields

Actually, it will still work if you’re using Google’s 2FA method that attaches to your mobile device. When I sign in, even after I provide a correct passphrase, I receive a notification on my phone that I have to approve to allow the access. However, for some other types of custom 2FA you may not be able to attach this way.

## K. de Jong

Not if you enrolled into the Advanced Protection Program of Google. That’s when you exclusive have to use a YubiKey. Unsafe 2FA is blocked. Then you need Chrome/Chromium, which is not used in GNOME online accounts.

## Paul W. Frields

Right, my point was about the standard 2FA method specifically, which suffices for most users. You already made the exception of APP clear. 🙂

## Mario Castellano

Hi, is there something similar for Microsoft Onedrive?

## Paul W. Frields

The GNOME Online Accounts system doesn’t support OneDrive. There should be other ways to sync to OneDrive using Fedora, though, that are searchable online.

## Mario Castellano

Sure, right now I’m using Rclone Browser, but nautilus integration was a more interesting and practical option.

Thank you.

## Colin Wu

I use rclone script in a bash script that run at startup. It mounts my OneDrive under my home and can access it from any GUI file manager. Have a look at rclone.org

## Mario Castellano

Done, I already had the software installed and the config done because of Rclone Browser, I only had to launch the rclone mount command and everything is done.

Thank you very very very very very very very very very very much!!

## Danny Voisine

How does one use this feature if they use xfce?

## Paul W. Frields

You’ll need to use some other method — this feature is part of GNOME, and you can use it with Fedora Workstation. Some other commenters have already mentioned alternatives, so feel free to try one of those.

## Harish Ketheeswaran

i like fedora very much. I Like the polished gnome design than windows 10 start.KEEP IT UP FEDORA

## Silvia

Is there a way to do this but in KDE or XFCE?

## Paul W. Frields

Asked and answered earlier.

## Bruno

If the remote access does not work well for your workflow, there is also RClone https://rclone.org/drive/ (it has a nice GUI too).

If your workflow is even more demanding, you can add on top : https://github.com/cjnaz/rclonesync-V2 RCloneSync a two way sync Python script.

But still it would be nice to have an optimized two-way sync client.

## Vd

What about LXDE ?

## hammerhead corvette

Although the title is Explicit in stating “Fedora Workstation” which has Gnome by default, there are other Fedora spins and the title leaves toomuch to the assumption of “Fedora”. The title should be changed to “Connect your Google Drive with Gnome”

## ewrgfergf

i3wm have any program?

or terminal? I’m not using gnome

## Gregory Bartholomew

If you still have GNOME installed on your workstation, you can use it to do a one-time setup/initialization of the online account. Once the online account exists, nautilus can access it; even when run under i3wm. When you change your Google password, you can use the “Passwords and Keys” (aka seahorse) application to update the password that is stored in your keyring.

FYI & YMMV

## Patrick O'Callaghan

Not sure if it’s appropriate to mention this here but as several people are asking, there is a commercial program called Insync which does a fairly good job of syncing with Google Drive (and OneDrive). I’ve used it for several years. There is a one-off license fee and they have an RPM package that’s updated frequently. I only mention this because of Google’s perennial reluctance to release a Linux equivalent to their Windows and MacOS offerings.

There are also a number of free software alternatives which can be found by searching for “google drive linux” but those I’ve seen don’t seem quite as slick or regularly maintained.

## Tobias

As Bruno said rclone works really well. It can mount google drive to your filesystem so you do not have to start the sync process manually. It feels a little bit slow sometimes but overall it works fine. And it’s open-source (unlike insync) and it is, in contrast what Patrick said, pretty well maintained.

## sonu sahu

Sorry to ask but what is the additional benefit of connecting google drive to fedora workstation

## Vernon Van Steenkisy

If I am working remotely with only my Iphone and its HDMI dongle and I accidentally left my pdf presentation file on my fedora workstation, I can ssh into my fedora workstation from my Iphone and use the cp or mc command to copy the pdf to the fedora workstation google drive mount point which my Iphone can then easily access through the google drive app. There are many similar such use cases.

Another pro tip. if you use the bash shell, type the command

set -o vi

after sshing into your workstation. This will give your command line vi key bindings instead of the default emacs key bindings. One of the many advantages is that you can now use the hjkl keys as arrow keys which is nice because the Iphone and Ipad keyboards don’t have arrow keys.