【教程】Ubuntu 20.10离线安装openssh-server

Ubuntu 20.10离线安装openssh-server

  • 参考
  • 描述
  • 参考步骤
  • 共享网络的解决方案

参考

Ubuntu 20.10镜像下载:https://old-releases.ubuntu.com/releases/20.10/
教程:Where to get complete offline installer for openssh-server?

描述

某离线ubuntu20.10主机通过共享网络方式没能成功联网,因此采用离线方式安装deb。
先下载相同版本的ubuntu虚拟机,在其上下载openssh-server所需的离线安装包,再通过usb等外设放入离线的ubuntu20.10主机上,安装deb。

参考步骤

下载并部署好镜像后,在镜像中执行如下命令,获得openssh-server的deb安装包和依赖安装包。

  1. 创建文件夹

cd ~/Desktop/

mkdir openssh-server-installer&&cd openssh-server-installer/

sudo apt-get update

如果还源,记得换中科大的源:(中科大已经不再支持ubuntu 20.10 groovy)

deb https://mirrors.ustc.edu.cn/ubuntu/ groovy main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ groovy main restricted universe multiverse

deb https://mirrors.ustc.edu.cn/ubuntu/ groovy-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ groovy-security main restricted universe multiverse

deb https://mirrors.ustc.edu.cn/ubuntu/ groovy-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ groovy-updates main restricted universe multiverse

deb https://mirrors.ustc.edu.cn/ubuntu/ groovy-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ groovy-backports main restricted universe multiverse

## Not recommended
# deb https://mirrors.ustc.edu.cn/ubuntu/ groovy-proposed main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu/ groovy-proposed main restricted universe multiverse

  1. 下载openssh-server软件包(这个得到的是.deb文件)。

sudo apt-get download openssh-server

  1. 下载 openssh-server 的依赖项。

sudo apt-get build-dep --reinstall --download-only -o dir::cache=~/Desktop/openssh-server-installer/ openssh-server

然而,如上的2,3步骤并没有效果,最后参考:在Ubuntu本地下载软件包并递归下载其所有依赖包 其中的第二个方法,递归下载了所有的依赖包并安装才成功运行起来。

  1. 下载额外的依赖项(上面的命令没有下载这些)。

sudo apt-get download openssh-sftp-server openssh-client

  1. 安装OpenSSH服务器(确保所有.deb文件都在同一个文件夹中)。

sudo dpkg -i *.deb

分享下我最终下载成功所依赖的诸多deb包:https://wwc.lanzoui.com/iB6zr0ede3uf 密码:b49h

共享网络的解决方案

此方法在此主机上未成功。仅供参考

Windows共享网络给不上网的linux,以实现linux上网
参考:window10共享网卡给linux服务器上网
1.windows通过wifi上网,打开其网络适配器,配置共享
【教程】Ubuntu 20.10离线安装openssh-server_第1张图片

【教程】Ubuntu 20.10离线安装openssh-server_第2张图片

2.之后windows的有线网卡IP会被设置为固定值,之后设置服务器的网卡,设置为同网段,网关为windows的有线网卡的IP地址 (下图是kali的,配置/etc/network/interfaces,如果是ubuntu,参考为Ubuntu 20.04 设置静态IP简明教程)
【教程】Ubuntu 20.10离线安装openssh-server_第3张图片

3.再重启linux网卡即可,ifconfig eth4 up

你可能感兴趣的:(教程,修电脑,ubuntu,linux,运维)