ssh远程登陆virtualbox debian12

发布时间 2023-07-16 15:57:32作者: BuzzWeek

1. 检查ssh是否安装

ps -e | grep ssh

image

只有ssh-agent表示没装

1.1 安装ssh-server

sudo apt install openssh-server -y

image

2. Virtualbox网络设置

image
image

3. ssh远程登陆

# 获取ip
hostname -I

image

其它问题

blue is not in the sudoers file

$ su root
$ vi /etc/sudoers
blue ALL=(ALL:ALL) ALL

设置更新源

$ vi /etc/apt/sources.list

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware

# deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware

deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware

参考

https://mirrors.tuna.tsinghua.edu.cn/help/debian/