How to install openssh on a machine without an internet connection?

So, I would like to install OpenSSH-server, unfortunately, the Debian machine is offline. Is there a simple way of installing ssh offline, including any dependencies?

1 Like

I’ve never had to but check out this link:

1 Like

Have a look at apt-offline - It’s for Debian (And Debian based) system only. It can help you install/upgrade packages, and their dependencies, on a Debian box with no direct internet connection.

Some good documentation here and here.

1 Like

I would give you a step by step approach to fix that.

You would have to use a USB that has the Debian version you want and boot up live. Next thing is to connect the offline Debian machine with the use of a network cable to the live environment. From the live environment, you attempt to access the offline machine’s root directory by Chroot.

Use apt-get install openssh-server and it’s dependencies using the Chroot.

At this point, you can reboot the offline machine and you sure now have SSH access.

You can download the .deb package of OpenSSH from the Debian Packages website and install it using the dpkg command.

I think that the open-ssh is something that is not something new and you can install the debian package. However if you are using the ZSH shell then the way to go is

$chsh

and it will ask for the type of the shell emulator that you want to invoke and you can select the ZSH. In that case, if you check the ~/.ssh files then you can easily add the file additions and the keys there to the SSH connection.

alles super,
Gaurav