Google Drive on Linux

Support Coming Soon

6 years ago Google posted that Linux support for Google Drive was in the works and to hang tight while they worked on it.

screen

This has been such a pain point to many users for Google Drive that one user even has a page on Github with a timer since the day of this post: https://abevoelker.github.io/how-long-since-google-said-a-google-drive-linux-client-is-coming/

Lucky for us, there are many developers out there that have taken on the task of creating a client for Linux, since Google is taking a little longer than expected.

Why not Windows

Several years ago while working on my Bachelors degree, I realized I needed to learn more about Linux. What better way to learn about a new OS than immersing yourself in it, so I started to look at the applications I was using and researching their FOSS alternatives. Most were simple (Chromium, LibreOffice, Atom) but my one hangup was my need to sync files with Google Drive.

I am cheap, and when I was going through this I had to be even more so since I needing to pay for school and cover my families living expenses, every penny counted. So I setup my computer to dual boot Windows and Linux and started trying out several different options. Some went through 3rd party servers (not preferred), others were just clunky and did not automatically sync files as they were updated locally. I finally stumbled across an option that I have used ever since.

InSync

No relation to the boy band, InSync is a paid product that works on all major OS platforms including Linux. It operates just like the Windows client for Google Drive. Once installed, you give it a folder to link to your Google Drive and all your files show up there. If you update one, it will sync it immediately to Google’s servers. There is also a status icon that will show you that sync status.

release_OG

But It Costs Money

Yep, there is a cost for this amazing little program. Thankfully, they are not like some of the similar applications that try to get a monthly fee out of you. InSync is a one-time fee and they give you access to install the application on as many systems as you like. The license is tied to your Google account and it works fine with GSuite accounts. As of the writing of this blog, a standard “Prime” license is $29.99 per Google account. They also give a free, no credit card needed, 15 day trial so you can see if it fits your use case before shelling out the cash.

PRIME

$29.99
  • Windows, Mac, Linux
  • Multiple accounts One license per Google account
  • Unlimited computer installs
  • [email protected]Sync top folders anywhere on your desktop
  • [email protected]Merge the contents of a cloud and local folder
  • Sync On Demand Sync files only when you need the

$30 might seem like a lot for such a simple application, but at the end of the day it is worth every penny to not have to deal with running Windows, just because Google hasn’t delivered on a promise they made 6 years ago.

Go Get It

Use this link if you are interested in signing up.

I get a referral bonus for it, and will use that to give away free licenses to help others in the community if enough people use it.

First steps on a newly installed server.

After launch a new server, that was not a full install of my own, I have found that the following steps help get it to a working state with a basic level of security. This is not all inclusive and it really just a baseline. This is specific to Ubuntu, but can be easily modified for any flavor of Linux.

With a service like Digital Ocean, AWS, or any similar service you will be given a basic install with only a root user.

Change the default root password

Start by changing that root password to something that is very complex, and save it somewhere secure.

passwd

This password will only be needed if you lose the ability to login over ssh or lose your sudo password.

Update the system. This will also save time as you start to install your applications, since everything will be nice and updated.

apt-get update && apt-get upgrade

Install Fail2ban 

Fail2ban monitors login attempts to a server and blocks IP’s that fail to successfully login too many times. It can be tweaked later on, but works good enough out of the box. Be careful after installing Fail2ban, since you can lock yourself out of your own server if you have more than 3 failed login attempts. If that does happen, just go grab a beer and wait for your own block to expire before logging in again.

apt-get install fail2ban

Setup a New User

Since it is never a good idea to allow root login to your server, now you need to setup a new login user. Replace ‘NewUser’ with whatever you want to use. Make sure the password you use here is complex and keep a note of it. It will be used later on for super user access.

useradd NewUser 
mkdir /home/NewUser 
mkdir /home/NewUser/.ssh 
chmod 700 /home/NewUser/.ssh
passwd NewUser

Setup public key authentication

Passwords suck! For secure remote ssh access,public key authentication will provide a much better option. It also simplifies your login process since you don’t have to remember a long and complex password.

vim /home/NewUser/.ssh/authorized_keys

Add the contents of the id_rsa.pub to this file.

chmod 400 /home/NewUser/.ssh/authorized_keys 
chown NewUser:NewUser /home/NewUser -R

Test The New User and Enable Super User Access

Open a new terminal or ssh session and attempt to login with the NewUser account. It’s really important to keep the original session open to fix thing if you screw up. If the login works, then you can go back to your original terminal to enable Super User access.

visudo

Find the list of users and add NewUser to the list. This will grant Super User access when the user authenticates with their own password.

## Allow root to run any commands anywhere
root ALL=(ALL) ALL 
NewUser  ALL=(ALL) ALL

Secure SSH access

Disable root login for ssh and limit logins to a list of ip’s

vim /etc/ssh/sshd_config

Add these lines to the file, inserting the ip address from where you will be connecting from. If you access from different dynamic IP’s (home internet providers, cell phone network), you may want to skip the IP limit.

PermitRootLogin no 
PasswordAuthentication no 
AllowUsers [email protected](your-ip) [email protected](another-ip-if-any)

Restart SSH

service ssh restart