IPFire
Installation of sshnpd on the IPFire.org firewall
Last updated
Installation of sshnpd on the IPFire.org firewall
Last updated
IPFire provides a solid Firewall and uses a base Linux OS. The installation of the OS itself is well documented at ipfire.org. X64 and Arm devices like Raspberry PI's are well supported.
Make sure to configure the network interfaces and ensure you can get to the Web Interface on
SSH No Ports relies on the SSH daemon and so the first step is to enable it on the IPFire Web interface, under System.
We will also need to add the TMUX package via the web interface under the IPFire section click Pakfire, then add TMUX.
IPFire only has a root user after installation so the first step is to set up a non privileged account in this example we will use atsign
but feel free to pick your own. Login to the console or via SSH as root and type:
The next step is su to the user you just created and setup the directories sshnpd will need
Using sudo
allows you to get access to the root account if you need it but keep at a non root shell when you do not, its a good practice but optional.
As root you will need to edit the /etc/sudoers file and uncomment the line below as show by removing the #. Note you may need to use w!
in vi to force the update of the file.
Once done then you can add the sudo group and then add the username atsign to the group with the following commands as root.
Then add a password to the atsign account again as root
Once completed then check everything is working by su - to atsign the using sudo -s to get back to root.
As atsign (not root!) download the SSH No Ports software, which we can do with curl and then unpack the archive with tar. The curl command below brings in the x64 CPU architecture file if you are using Arm/Arm64 then curl down the right option by picking the right link from:-
To install the software just cd and run the install command
You will see some errors at this stage as IPFire uses fcron not cron which needs root powers to install fcron jobs which we will handle soon.
The sshnpd is started via a script and that script and that script needs some simple edits. You will need to know your atSign for the device (_device) and manager (_client). to edit use nano/vi on this file.
Then edit the lines as below with your details.
IPFire has non standard base certificates but we can install the latest versions from Mozilla so the sshnpd daemon can use TLS, by using these commands.
If you have not got your atKeys file you will need to use at_activate to get them as explained in the the advanced installation guide. If you do have the keys for your device then they need to be in the ~/.atsign/keys directory. You can scp them over for instance. Its a good idea to chmod them to 600.
As mentioned above fcron is used not cron so a couple of extra steps are required. First add your username to the /etc/fcron.allow file.
Then add your username ours looks like this
Once that is completed then you can add an entry to atsign's fcron, this can only be done as root and uses vi to edit by default.
Then you will need to add the following line
That's it you are done!
To test you can reboot or as atsign run the command below and try and log in using sshnp
At this point you will be able to log in remotely using sshnp. The first time you will need to specify a ssh key using the -i and -s arguments. This will put the public key into the authorized_hosts file on the IPFire machine. In my case I would use.
your will look like something similar depending on your SSH Key pair (you can generate one if you do not have one with ssh-keygen) and your client/device atsigns.
When you get logged in you can remove the -s and the -i flags and login on subsequent logins as the public key will be in place on the IPFire machine. You will have to put the keys you want to use in ~/.ssh/config also on the machine you are ssh'ing from, in my case I use a single line.
Remember to keep your SSH and Atsign keys safe and make a copy offline.
You are now able to login from anywhere as long as the firewall and you have Internet access. Congrats!
If you would like to remove the ssh daemon from the GREEN side as well then you can edit the /etc/ssh/sshd_config
file to only bind on localhost but updating this line.
to
and then reboot or restart the sshd daemon.