<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Openvpn on Terminal</title><link>https://muisti.atk-neuvos.fi/tags/openvpn/</link><description>Recent content in Openvpn on Terminal</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 30 Apr 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://muisti.atk-neuvos.fi/tags/openvpn/index.xml" rel="self" type="application/rss+xml"/><item><title>Android &lt;-&amp;gt; PC notepad style file editor/sync</title><link>https://muisti.atk-neuvos.fi/posts/filesync/</link><pubDate>Wed, 30 Apr 2025 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/filesync/</guid><description>&lt;h1 id="general-info"&gt;General info&lt;/h1&gt;
&lt;p&gt;Mobile and PC can be in any different networks, ssh is used for comms.
OpenVPN is used for handy and secure access bridging any networks.&lt;/p&gt;
&lt;h1 id="android-setup"&gt;Android setup&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;install “Simple SSHD” from play market, it is dropbear sshd daemon
&lt;ul&gt;
&lt;li&gt;inject your public key into phone sshd&lt;/li&gt;
&lt;li&gt;configure port etc&lt;/li&gt;
&lt;li&gt;create sshd shortcut on home screen&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;install fossify notepad from play market
&lt;ul&gt;
&lt;li&gt;configure new txt file with export to sd option&lt;/li&gt;
&lt;li&gt;make the file /sdcard/000notepad.txt&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="linux-setup"&gt;Linux setup&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;working ssh client and some network required&lt;/li&gt;
&lt;li&gt;openvpn client is required&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="place-editor-script-into-pc-binmemo"&gt;Place editor script into PC ~/bin/memo&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;#!/bin/bash
MNT=$(mktemp -d); sshfs phone:/sdcard/ $MNT &amp;amp;&amp;amp; vi $MNT/000notepad.txt &amp;amp;&amp;amp; umount $MNT &amp;amp;&amp;amp; rmdir $MNT
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="ssh-client-config-setup-with-lanvpn-aliasing"&gt;SSH client config setup with LAN/VPN aliasing&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# phone in VPN network
Match originalhost op10 localnetwork 172.16.10.0/24
Hostname 172.16.10.2

# phone in home LAN
Host op10
HostName 192.168.1.44
Port 2222
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="usage"&gt;Usage&lt;/h1&gt;
&lt;p&gt;Run memo command in any network while phone sshd is running and you can view/edit the file from anywhere&lt;/p&gt;</description></item><item><title>OpenVPN networking</title><link>https://muisti.atk-neuvos.fi/posts/openvpn/</link><pubDate>Thu, 03 Apr 2025 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/openvpn/</guid><description>&lt;h1 id="package-setup-for-building-files-at-any-host-computer"&gt;Package setup for building files at any host computer&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;sudo apt install easy-rsa openssl openvpn
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="package-setup-for-openvpn-server"&gt;Package setup for OpenVPN server&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;sudo apt install openvpn
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="create-directory-for-building-and-keeping-keyfiles"&gt;Create directory for building and keeping keyfiles&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;mkdir ~/vpn_repo
cd ~/vpn_repo
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="-from-here-on-everything-happens-at-vpn_repo--"&gt;*** From here on, everything happens at ~/vpn_repo !!! ***&lt;/h1&gt;
&lt;h1 id="fetch--prepare-easy-tls"&gt;Fetch &amp;amp; prepare easy-tls&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wget https://raw.githubusercontent.com/TinCanTech/easy-tls/refs/heads/master/easytls
chmod 750 easytls
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="for-creating-all-the-needed-openvpn-server-files"&gt;For creating all the needed OpenVPN server files&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;cat &amp;gt;server.sh&lt;/code&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;#!/bin/bash

# cert &amp;amp; ca expiry 10 years
export EASYRSA_KEY_SIZE=2048
export EASYRSA_CA_EXPIRE=3650
export EASYRSA_CERT_EXPIRE=3650

TARGET=$1
USER=$2
PASS=$3

if [ -z $TARGET ]
then
 echo &amp;#34;Give servername as arg&amp;#34;
 exit
fi

make-cadir $TARGET
if [ $? -eq 0 ]
 then
 cd $TARGET

 # build server cert package
 ./easyrsa init-pki
 echo $TARGET | ./easyrsa build-ca nopass
 ./easyrsa gen-dh
 echo yes | ./easyrsa build-server-full $TARGET nopass

 # prepare tls-auth key
 if [[ ! -d pki/easytls ]]
 then
 ../easytls init-tls
 ../easytls build-tls-auth
 fi

 cd ..
 mkdir -p out
 # symlink all files needed on server side
 ln -srf $TARGET/pki/private/$TARGET.key out/
 ln -srf $TARGET/pki/ca.crt out/${TARGET}_ca.crt
 ln -srf $TARGET/pki/easytls/tls-auth.key out/${TARGET}_tls-auth.key
 ln -srf $TARGET/pki/dh.pem out/${TARGET}_dh.pem
 ln -srf $TARGET/pki/issued/$TARGET.crt out/

 echo &amp;#34;#### OpenVPN server files&amp;#34;
 find out | tail +2
 echo &amp;#34;####&amp;#34;
 echo &amp;#34;Copy these files to server /etc/openvpn/server/&amp;#34;
fi
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="for-creating-client-profiles"&gt;For creating client profiles&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;cat &amp;gt;gen_user.sh&lt;/code&gt;&lt;/p&gt;</description></item></channel></rss>