root@VM-16-16-debian:~# uname -a Linux VM-16-16-debian 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64 GNU/Linux
1.1 安装vim编辑器
1
apt install vim
1.2 Root用户连接SSH
系统默认是不能使用Root用户去使用SSH连接到VPS的,我们需要修改配置。
1 2 3 4
sudo vim /etc/ssh/ssh_config #修改或增加 PermitRootLogin yes 配置
sudo systemctl restart ssh #重启SSH服务生效
安装sudo命令,创建管理员用户,后面都以此用户进行系统管理而不是root用户。
1 2
root@debian:~# useradd -m -s /bin/bash -G sudo test root@debian:~# passwd test
让我们创建的用户和root有同等的权限
1 2 3 4 5 6 7 8 9
#1.添加用户,首先用 adduser 命令添加一个普通用户,命令如下: #2.新增一个test账号 adduser test #修改密码 passwd test #3修改 /etc/sudoers 文件,找到 root 一行,在 root 下面添加一行,如下所示: #Allow root to run any commands anywhere root ALL=(ALL) ALL test ALL=(ALL) ALL #修改完毕,现在可以用 yzgxhwj 帐号登录,然后用命令 sudo su—, 即可获得 root 权限进行操作。
deb http://mirrors.tencentyun.com/debian bookworm main contrib non-free non-free-firmware #deb-src http://mirrors.tencentyun.com/debian bookworm main contrib non-free non-free-firmware deb http://mirrors.tencentyun.com/debian bookworm-updates main contrib non-free non-free-firmware #deb-src http://mirrors.tencentyun.com/debian bookworm-updates main contrib non-free non-free-firmware deb http://mirrors.tencentyun.com/debian-security/ bookworm-security main contrib non-free-firmware #deb-src http://mirrors.tencentyun.com/debian-security/ bookworm-security main contrib non-free-firmware