VMware安装Debian后的几件事

1. 添加sudoers用户
1)切换到root用户
su
2)修改sudoers文件权限, 一般存放在/etc下.
chmod u+w /etc/sudoers
3)修改sudoers文件, 找到 root ALL=(ALL:ALL) ALL这一行, 在下面添加 用户名 ALL=(ALL:ALL) ALL 即可。
4)修改sudoers文件权限, 取消写权限.
chmod u-w /etc/sudoers
5)也可参考Debian 10(Buster)安装后要做的前8件事http://www.linuxboy.net/linuxjc/145040.html

2. 更新
$sudo apt update
$sudo apt upgrade
$sudo apt install build-essential

3. 使用Git Bash连接虚拟机中的Debian
1)查看Debian IP
$ip addr show
2)连接
$ssh yyy@xxx.xxx.xxx.xxx
说明: yyy: Debian用户名
            xxx.xxx.xxx.xxx: Debian IP
报错:ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused
3)打开22端口
3-1) 安装ufw防火墙
$sudo apt install ufw
$sudo ufw default deny incoming
$sudo ufw default allow outgoing
$sudo ufw allow ssh
$sudo ufw allow 22
$sudo ufw enable
再连接还有问题, 报相同的错误.
4)安装ssh服务
$sudo apt install openssh-server
5)再次连接, 连接成功。

posted @ 2021-02-17 19:33  seifguo  阅读(131)  评论(0编辑  收藏  举报