diff --git "a/05\346\237\257\346\230\200\345\220\253/2024-05-15-\345\256\211\350\243\205\350\231\232\346\213\237\346\234\272\345\222\214Debain.md" "b/05\346\237\257\346\230\200\345\220\253/2024-05-15-\345\256\211\350\243\205\350\231\232\346\213\237\346\234\272\345\222\214Debain.md" new file mode 100644 index 0000000000000000000000000000000000000000..6ae301d2b2bc031c2dac68de671556595c0e73e1 --- /dev/null +++ "b/05\346\237\257\346\230\200\345\220\253/2024-05-15-\345\256\211\350\243\205\350\231\232\346\213\237\346\234\272\345\222\214Debain.md" @@ -0,0 +1,43 @@ +``` + Linux基础 +1.学习Debian的两种方式 +安装虚拟机,再安装debian,快照 +利用阿里云、华为云、腾讯云,也利用快照功能。对服务器进行存档 + +2.准备好 虚拟机VM 17版本+Debian 12.5 64位的ISO文件 + +3.先安装VM,再创建一个新虚拟机 + +4.如何下载一个Debian的安装镜像 https://www.debian.org/ + +5.直接在虚拟机操作debian很麻烦,所以想办法,用SSH远程登录它 + +6.默认Debian没有安装SSH服务端,需要自己安装 + +apt-get install ssh -y // 需要root权限,安装SSH服务端 +ip addr show // 查看IP地址 +ifconfig // 需要root权限,可以借权sudo +// 以上两步,就可以让我们用普通用户远程登录了,但是默认下root是不可以直接登录的。需对ssh做配置 +// 为了方便我们编辑文件。安装一个vim编辑器,默认是vi + +7.修改ssh的服务端配置文件/etc/ssh/sshd_config文件 +vim /etc/ssh/sshd_config +Port 22// 开启端口22 +PermitRootLogin yes // 允许root登录 +PasswordAuthentication yes // 采用密码验证模式 +PermitEmptyPasswords no // 禁用空密码 +// 重启ssh,让修改后的配置生效 + systemctl restart ssh +// /etc/init.d/ssh restart 同上的效果 + +8.如何借用root权限 +1. 安装sudo +apt-get install sudo -y +2. 将普通用户名加入 +vim /etc/sudoers +## +## Allow root to run any commands anywhere +root ALL=(ALL) ALL +用户名 ALL=(ALL) ALL +3.重新登录普通用户,就可以使用sudo功能 +``` \ No newline at end of file