Optimize Armbian Installation on Android TV Box (WiFi)
1. Setting up shortcut on Windows desktop:
Create a shortcut on windows desktop to avoid typing long command
- Right Click in any empty area on your screen (desktop)
- Select "New" and then "Shortcut" and cut-n-paste below in the box where "Type the location of the item:"
- %windir%\system32\cmd.exe /F /K "ssh arcube@192.168.50.47"
- Click "Next" and give this shortcut a name e.g. "192.168.50.47"
2. Setup SSH Keys
To me its annoying to type passwords every time I have to login to another machine/box within my home network so here is how I set up ssh keys for password-less login
On Windows:Windows does NOT have openSSH installed by default but it is very easy to set it up Get started with OpenSSH for Windows
- Open "Settings", select "Apps" and then select "Optional features"
- Click on "Add a feature"
- Type OpenSSH client and then select "Install"
- Type OpenSSH server and then select "Install"
OPTIONAL:
- Towards bottom of "Optional features" window, under "Related Settings", Click on "More Windows features", it should pop up a new window to "Turn Windows features on or off"
- Scroll down towards the bottom of the window and select "Windows Subsystem for Linux" if it not already enabled.
In Windows Search, type "Services" and press enter to open the "Services" app
- Locate "OpenSSH SSH Server", double-click it and in the window which pops-up, change "Startup Type:" to "Automatic" is if it is not already selected and click "Start" button.
Open "Powershell" or command prompt (cmd.exe)
- Type "ssh-keygen -t ecdsa"
- Leave everything default and skip passphrase
- This will create your public and private keys under c:\users\<your_user_id>\.ssh\
- id_ecdsa <<-- private key
- id_ecdsa.pub
REMEMBER: your private key is like a wallet full-of-cash, NEVER GIVE IT TO ANYONE
On Linux:
- Type ssh-keygen -t ecdsa
Exchange keys between windows and linux:
On windows open notepad and open id_ecdsa.pub
Careful: DO NOT TYPE ANYTHING into notepad
Click on the shortcut you created above OR open a command prompt and type ssh <your_user_id_for linux_box>@<your_android/linux_box_ip_address>
e.g. ssh arcube@192.168.50.108
It will ask you for your password because keys are not setup yet
- cd .ssh
- sudo nano authorized_keys
type in your password for sudo
Carefully copy the whole text from notepad and right click into command prompt terminal into nano editor, this will paste text as below
- Close notepad - DO NOT SAVE
- Close nano editor (ctrl+X), it will prompt you to save buffer, select Y
- type "chmod 600 authorized_keys" on linux prompt
- close linux session by typing exit
- Now try to login again to linux box on command prompt window by typing e.g. arcube@192.168.50.108 and it should not ask for password.
- Change it to your USER-ID and IP
If you have multiple linux boxes then you would have to copy keys from windows to each linux box (authorized_keys file) and setup multiple shortcuts on windows desktop
3. Setup DNS to point to PiHole
If you are running a PiHole on your network then you can change the DNS server on your boxes by following below steps
- Go to your PiHole Admin and note down IP Address
- Login to tv-box and type
- nmcli device <<-- will show which device (end1 OR eth0) is available
- Note the CONNECTION value
- sudo nmcli connection modify "Wired connection 1" ipv4.dns "192.168.50.47"
- sudo nmcli device reapply end1
(you can repeat above setup to have multiple dns entries)
OR
- sudo nmcli connection modify "Supervisor eth0" ipv4.dns "192.168.50.47"
- sudo nmcli device reapply eth0
- nmcli device show eth0 | grep -i dns
The DNS queries will go to your PiHole server.
I have setup mine to have backup to openDNS and then backup to my ISP DNS
Comments
Post a Comment