Secure Shell (SSH) is a type of network that transmits data in an encrypted format. It is also a way to securely connect two computers. It is important to understand SSH in everyday life because it allows anyone to connect their devices to the internet, and for commercial reasons. This is important for individuals wanting to connect to their computers remotely; who’s running a data science lab without paying a cloud service (AWS, Google Cloud), having decent computing power, for people getting into data analytics and developmental purposes. I will show you my (more secure) way of setting up a connection to a Linux/Windows system.
My Set-Up:
AMD 2700x Processor Computer w/ Ubuntu 18.04 LTS terminal
2020 New iPad Pro (Wifi + Cellular) w/ Juno Connect ($10) + Termius
Note: Above are affiliate links for-profit and I also use these products. If you’d like to purchase them, this would help me tremendously :)!
Setting up the SSH Server
This is for the computer you want to connect to.
- Activate WSL (Open Admin PowerShell Prompt)
2. Download Ubuntu Terminal via Windows Store. Make a username and password when prompted.
3. Copy-paste these commands to update the Linux Subsystem.
$ sudo apt update -y
$ sudo apt upgrade -y
4. Configure SSH
$ sudo apt install openssh-server -y
$ sudo nano /etc/ssh/sshd_config
Configure
PubKeyAuthentication yes
PasswordAuthentication no
If you don’t know how to exit nano, it’s: ctrl + x
, y
, and press “enter”.
5. Set-up SSH (assuming you’re in the home directory)
$ sudo /usr/bin/ssh-keygen -A -y
$ ssh-keygen -t rsa -b 4096
$ chmod 700 .ssh
$ touch .ssh/authorized_keys
$ chmod 600 .ssh/authorized_keys
$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
$ sudo service ssh restart
$ sudo service ssh start
6. Portforward
This part is a bit confusing because people have different systems and windows versions. You must open port 22 from the Windows Firewall and on the Router. For the router, find the IPv4 of your computer, and configure the router so that the TCP protocol and port 22 is open for that IPv4.
7. Save Router IP
You can find this at ipchicken.com. Save this because you will be needing this to access your home network. Write it down somewhere for further steps.
8. Save Username
The username
is the name you first made when opening the terminal. This is easily found when opening Ubuntu. For example: <username>@<desktop_name>.
9. Save Private Key
You will need a copy of the private key to send to your remote computer/iPad. To do this, type:
$ cp .ssh/id_rsa /mnt/c/Users/<desktop_name>/<any folder to put key in>
After you have a copy of your private key, you can either email it to yourself on the iPad or transfer it via iTunes. Make sure to delete the copy afterward, for security purposes.
Setting Up Jupyter Notebook Server
This refers to the computer as a server. We’re almost there!
- Get python repository on Ubuntu
$ sudo apt install python -y
$ sudo apt-get install python3-distutils
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python get-pip.py
2. Get Jupyter Notebook and launch it on Ubuntu
$ pip install jupyterlab
$ jupyter lab --broswer=No
Connecting to Notebook Server with iPad
- Download Juno Connect (~$10) via App Store
-
Set up parameters
Add Jupyter Server...
Host:
This is the ip address
found on ipchicken.com
from the home server.
User:
This is the name created from the Unix/Ubuntu terminal when first starting it.
Private Key:
This is the key that was created from the ssh-keygen-t rsa -b 4096
command. You should already have this copy and transferred to your iPad in Files
.
Note: You can also paste the key from the clipboard by sending a text format of the key instead of a file. You can get the text format of the key with this command on the Ubuntu Terminal:
cat .ssh/id_rsa
and copy it (if you don’t know how, google it).
There we have it! Once set up, you are ready to connect to your Jupyter Notebook through iPad with Juno Connect :).
Note: You must have the Ubuntu Terminal Open and running both SSH server and Jupyter Notebook.
Sample (my set up)
If you have any questions, feel free to email (rsilvaniae@gmail.com) or comment below. I get back pretty quickly.
Hold on to the clap button for readers to find my story faster :)!
Thank for your post.
LikeLiked by 1 person