-
4 votes
-
Two-factor authentication for home VNC via Signal
For my particular use case I share my home PC with my spouse and since I'm the more tech-savvy of the two I'll need to occasionally remote in and help out with some random task. They know enough...
For my particular use case I share my home PC with my spouse and since I'm the more tech-savvy of the two I'll need to occasionally remote in and help out with some random task. They know enough that the issue will usually be too complex to simply guide over the phone, so remote control it is.
I'm also trying to improve my personal efforts toward privacy and security. To that end I want to avoid closed-source services such as TeamViewer where a breach on their end could compromise my system.
The following is the current state of what I'm now using as I think others may benefit from this as well:
Setup
Web
I use a simple web form as my first authentication. It's just a username and password, but it does require a web host that supports server side code such as PHP. In my case I just created a blank page with nothing other than the form and when successful the page generates a 6 digit PIN and saves it to a text file in a private folder (so no one can simply navigate to it and get the PIN).
I went the text file route because my current hosting plan only allows 1 database and I didn't want to add yet another random table just for this 1 value.
Router
To connect to my home PC I needed to forward a port from my router. I'm going to use VNC as it lets me see what is currently shown on the monitor and work with someone already there so I forward port 5900 as VNC's default port. You can customize this if you want. Some routers allow you to SSH into their system and make changes that way so a step more secure would be to leave the port forward disabled and only enable it once a successful login from the web form is disabled. In my case I'll just leave the port forwarded all the time.
IP Address
To connect to my computer I need to know it's external IP address and for this I use FreeDNS from Afraid.org. My router has dynamic DNS support for them already included so it was easy to plug in my details to generate a URL which will always point to my home PC (well, as long as my router properly sends them my latest IP address). If your router doesn't support the dynamic DNS you choose many also allow either a download or the settings you would need to script your own to keep your IP address up to date with their service.
Signal
Signal is an end-to-end encrypted messenger which supports text, media, phone and video calls. There's also a nifty command line option on Github called Signal-cli which I'm using to provide my second form of authentication. I just downloaded the package, moved to my $PATH (in my case /usr/local/bin) and set it up as described on their README. In my case I have both a normal cell phone number and another number provided by Google Voice. I already use my normal cell phone number with Signal so for this project I used Signal-cli to register a new account using my Google Voice number.
VNC
My home PC runs Ubuntu 18.04 so I'm using x11vnc as my VNC server. Since I'm leaving my port forwarded all the time I most certainly do NOT want to leave VNC also running. That's too large a security risk for me. Instead I've written a short bash script that first checks the web form using curl and https (so it's encrypted) with its own login information to check if any PIN numbers have been saved. If a PIN is found the web server sends that back and then deletes the PIN text file. Meanwhile the bash script uses the PIN to start a VNC session with that PIN as the password and also sends my normal cell the PIN via Signal-cli so that I can login.
I have this script set to run every minute so I'm not waiting long after web login and I also have the x11vnc session set to timeout after a minute so I can quickly connect again should I mess something up. It's also important that x11vnc is set to auto exit after closing the session so that it's not left up for an attacker to attempt to abuse.
System Flow
Once everything is setup and working this is what it's like for me to connect to my home PC:
- Browse to my web form and login
- Close web form and wait for Signal message
- Launch VNC client
- Connect via dynamic DNS address (saved to VNC client)
- Enter PIN code
- Close VNC when done
Code
Here's some snippets to help get you started
PHP for Web Form Processing
<?php // Variables $username = 'your_username'; $password = 'your_password_super_long_and_unique'; $filename = 'path_to_private_folder/vnc/pin.txt'; // Process the login form if($action == 'Login'){ $file = fopen($filename,'w'); $passwd = rand(100000,999999); fwrite($file,$passwd); fclose($file); exit('Success'); } // Process the bash script if($action == 'bash'){ if(file_exists($filename)){ $file = fopen($filename,'r'); $passwd = fread($file,filesize($filename)); fclose($filename); unlink($filename); exit($passwd); } else { exit('No_PIN'); } } ?>Bash for x11vnc and Signal-cli
# See if x11vnc access has been requested status=$(curl -s -d "u=your_username&p=your_password_super_long_and_unique&a=bash" https://vnc_web_form.com) # Exit if nothing has been requested if [ "$status" = "No_PIN" ]; then # No PIN so exit; log the event if you want exit 0 fi # Strip non-numeric characters num="${status//[!0-9]/}" # See if they still match (prevent error messages from triggering stuff) if [ $status != $num ]; then # They don't match so probably not a PIN - exit; log it if you want exit 1 fi # Validate pin number num=$((num + 0)) if [ $num -lt 100000 ]; then # PIN wasn't 6 digits so something weird is going on - exit; log it if you want exit 1 fi if [ $num -gt 999999 ]; then # Same as before exit 1 fi # Everything is good; start up x11vnc # Log event if you want # Get the current IP address - while dynamic DNS is in place this serves as a backup ip=$(dig +short +timeout=5 myip.opendns.com @resolver1.opendns.com) # Send IP and password via Signal # Note that phone number includes country code # My bash is running as root so I run the command as my local user where I had registered Signal-cli su -c "signal-cli -u +google_voice_number send -m '$num for $ip' +normal_cell_number" s3rvant # Status was requested and variable is now the password # this provides a 1 minute window to connect with 1-time password to control main display # again run as local user su -c "x11vnc -timeout 60 -display :0 -passwd $num" s3rvantFinal Thoughts
There are more secure ways to handle this. Some routers support VPN for the connect along with device certificates which are much stronger than a 6 digit PIN code. Dynamically opening and closing the router port as part of the bash script would also be a nice touch. For me this is enough security and is plenty convenient enough to quickly offer tech support (or nab some bash code for articles like this) on the fly.
I'm pretty happy with how Signal-cli has worked out and plan to use it again with my next project (home automation). I'll be sure to post again once I get that ball rolling.
13 votes -
Phish - First Tube (2000)
4 votes -
The history of blindfolded Punch-Out
11 votes -
POLYBIUS - The video game that doesn't exist
11 votes -
Teutoburg Forest 9 AD - Roman-Germanic wars
5 votes -
Sexual assault of men played for laughs
9 votes -
The broken formula of music biopics
7 votes -
Loneliness
41 votes -
DIY welding project
5 votes -
King Gizzard & The Lizard Wizard - Cyboogie (2019)
11 votes -
How diodes work
7 votes -
Please Don't Die Joey Janela // A short documentary
3 votes -
The Country Bears - Nostalgia Critic
4 votes -
This school district in Texas may create its own police force
6 votes -
Ultradance - Vuela Vuela (2011)
4 votes -
Why We Build The Wall (PhilosophyTube Cover)
7 votes -
An open letter to game developers from America's largest labor organization
10 votes -
The Digital Antiquarian: Ultima VII
6 votes -
The marketplace of ideas — or how to fortify democracy
8 votes -
MP40
8 votes -
Yellow Magic Orchestra - Rydeen (1979)
6 votes -
What equipment do I need to record for streaming?
Hello! I’m a musician that’s looking into recording video of myself as I’m playing at my home and then uploading it to YouTube. I was wondering if there were any users out there that do something...
Hello!
I’m a musician that’s looking into recording video of myself as I’m playing at my home and then uploading it to YouTube. I was wondering if there were any users out there that do something similar and what type of setup you have/would suggest if there are. I play acoustic, no electronic pickup.
I appreciate any suggestions and hope everyone has a great day!
13 votes -
Tetris 99 isn’t just a great twist on a classic—it’s a gameplay revolution
28 votes -
What are reliable sites for thoughtful content from a non-American perspective?
I came across a site about Chinese tech and video gaming and found it very Buzzfeed-y with its headlines and writing. It made me wonder what are the websites that curate a standard of thoughtful...
I came across a site about Chinese tech and video gaming and found it very Buzzfeed-y with its headlines and writing. It made me wonder what are the websites that curate a standard of thoughtful articles, essays, discussion, etc. and aren't part of the American internet scene.
I don't care what language it's in, what it's about, what country specifically it's centered on, if it's community-centric or not. If you have a suggestion, let's hear it.
Edit: An example I have is The Blizzard. It's really a subscription-model digital magazine (about soccer) but you can read various articles online.
21 votes -
Pearl Jam - Oceans (1991)
6 votes -
Herb Geller - Sudden Senility (1975)
5 votes -
Whores - Bloody Like The Day You Were Born (2016)
4 votes -
The Verge is sending out copyright strikes to people who criticized their PC build
For those of you not in the loop, the Verge created a PC build guide back in September, and it was...bad, to put it lightly. They took down the original video after a storm of criticism, but this...
For those of you not in the loop, the Verge created a PC build guide back in September, and it was...bad, to put it lightly. They took down the original video after a storm of criticism, but this guy reuploaded it, if you want to see it.
Kyle (aka Bitwit) created a response video to it, which got copyright striked (which is more severe than a claim and has to be done by a human, unlike content ID claims), in addition to ReviewTechUSA. Ironically, the Verge published an article about abuse of the copyright system just 3 days ago (2 days when the videos were taken down yesterday).
The Verge should have taken more responsibility to begin with, now that the dust have settled they seem bent on reminding everyone how bad their video was.
Edit: Bauke pointed out Kyle's video is back up! This is not because the Verge retracted their claim, but because YouTube actually had a human review it and determine it was fair use (which usually isn't the case from what I've heard).
41 votes -
Are negative ions good for you?
8 votes -
Pastry chef, Claire Saffitz, attempts to make gourmet Ferrero Rocher | Gourmet Makes
12 votes -
Nintendo Direct - February 13, 2019
22 votes -
Blackstratblues - Ode to a Sunny Day (2015)
3 votes -
Where's Buzzy? Disney World’s stolen animatronic.
5 votes -
Mike Oldfield - The Song of Hiawatha (1978)
4 votes -
The impossible architecture of video games
7 votes -
How Blade Runner reinvented adventure games
12 votes -
Dot. - Everybody Dances to Techno (2017)
4 votes -
CAAApitalism: The successful failure of videogames
6 votes -
DF Retro Episode 49: Contra III - The Alien Wars
11 votes -
Isn't the number of groups too restrictive?
I know that tildes is still a small community (sub 9k) but I find the number of groups too restrictive. I am mainly a redditor so I am used to subscribing to many subs, most of which are not...
I know that tildes is still a small community (sub 9k) but I find the number of groups too restrictive. I am mainly a redditor so I am used to subscribing to many subs, most of which are not "main" subs.
For example, shouldn't there be a group for "countries", so one could post in countries.germany or countries.finland in the future? Also, how come there is no videos? I can understand the reasoning that a video is (almost) always about a given subject but where should I post, for example, a video of "ASMR"? Should it go to health? Should chess posts go to "games" or "sports"?
I find this idea of groups a bit too comfusing, perhaps because I am used to subreddits..
Maybe it is not a bad idea to create some kind of map, with an handy link in the site, so one knows in which group one should post a certain something.
27 votes -
Above & Beyond Acoustic - On My Way To Heaven (Live At The Hollywood Bowl)
4 votes -
Sack of Constantinople 1204 - Fourth Crusade
8 votes -
Purl | Pixar SparkShorts
12 votes -
Kingdom Hearts III (dunkview)
22 votes -
List of motion-control games for Nintendo Switch
Just as with the Wii, I think the motion controls are a big and fun feature of the Switch. I have already searched online, but could not find a list of games that have motion controls (and in what...
Just as with the Wii, I think the motion controls are a big and fun feature of the Switch.
I have already searched online, but could not find a list of games that have motion controls (and in what way). I did see some attempt to put it on Wikipedia, but it was removed due to being too specific to be on Wikipedia itself.
If anyone found anything or is willing to help out, we could collaboratively write one up. What the best place for it would be, I do not know yet, but WikiData pops to mind.
I see votes, but I see no comments ...no idea how to interpret that.
7 votes -
Bagels | Basics with Babish (feat. Dan Souza)
7 votes -
Venturing into sacred space | Archetype of the magician
4 votes -
Health - Black Static (2019)
3 votes -
2018 Steam Awards winners announced
https://store.steampowered.com/steamawards/ Video direct link: https://steamcdn-a.akamaihd.net/store/promo/steamawards/Steam_Awards_2018_04_NoCountdown.mp4 Wikipedia table with results:...
https://store.steampowered.com/steamawards/
Video direct link:
https://steamcdn-a.akamaihd.net/store/promo/steamawards/Steam_Awards_2018_04_NoCountdown.mp4Wikipedia table with results:
https://en.wikipedia.org/wiki/Steam_Awards#2018The "Game of the Year" Award The "VR Game of the Year" Award The "Labor of Love" Award The "Best Developer" Award The "Best Environment" Award The "Better with Friends" Award The "Best Alternate History" Award The "Most Fun with a Machine" Award 19 votes