Debian 10 打开ssh

光盘安装的时候,不安装额外的组件。
要通过tty终端登录,先配置SSH。

1.解决vim退格键失灵的问题

打开/etc/vim/vimrc.tiny,输入并保存

set nocompatible
set backspace=2

2.修改Debian安装源,更改为国内镜像

打开/etc/apt/sources.list

deb http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib

deb-src http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb-src http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib

然后运行

apt-get update
apt-get upgrade

3.安装openssh-client和openssh-server,并打开ssh登录

apt-get install openssh-client
apt-get install openssh-server

打开ssh服务

systemctl status sshd

image

用netstat命令查看端口(
安装net-tools
apt install net-tools
)

netstat -tulpn | grep 22

4.虚拟机端口映射设置

image

5.Putty设置

image

登录成功!
image

验证

你可能感兴趣的:(debian,linux)