Debian初体验之基础设置
![](https://www.evernote.com/shard/s122/sh/31348b55-b9f4-4170-84d7-0c32ce32fc4e/bAUDNOvzyZ0EvmU9oLlA3aHF47s8MSmutxc4BRfd059Sqs5WiW0oDsdUVg/deep/0/image.png)
如何开启debian的ssh远程管理?
https://www.xxlxy.com/153.html
如何查看debian的磁盘信息
lsblk
debian 如何启动桌面(debian 桌面)
使用这个工具:tasksel,用来配置/安装桌面系统
选择那个一个桌面?
Gnome一步到位,不想要遇到xface的奔溃机率(踩雷,排雷)
Retrieving file 10 of 1173 (7h 12min 16s remaining)
简直搞笑了
如何Debian切换源,来加速安装?
可以通过编辑 /etc/apt/sources.list 文件来更改Debian源
思路:https://blog.fallenbreath.me/zh-CN/2023/pve8-change-sourceslist/
# sources.list
sed -i 's|^deb http://ftp.debian.org|deb https://mirrors.ustc.edu.cn|g' /etc/apt/sources.list
sed -i 's|^deb http://security.debian.org|deb https://mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list
还是没有生效的感觉不知道是不是PVE的缘故?切换方案:
wget https://ghproxy.com/https://raw.githubusercontent.com/oooldking/script/master/superupdate.sh
bash superupdate.sh cn
bash superupdate.sh 163
bash superupdate.sh aliyun
bash superupdate.sh aws
如果配置的文件不满意,一键还原
bash superupdate.sh restore
docker 里面换源
显然是为了docker里面的系统(比如PHP,Enginx等)在安装插件或者特定包的时候速度加快
思路:https://yeasy.gitbook.io/docker_practice/install/mirror
目前主流 Linux 发行版均已使用 systemd 进行服务管理,这里介绍如何在使用 systemd 的 Linux 发行版中配置镜像加速器。
请首先执行以下命令,查看是否在 docker.service 文件中配置过镜像地址。
$ systemctl cat docker | grep '\-\-registry\-mirror'
如果该命令有输出,那么请执行 $ systemctl cat docker 查看 ExecStart= 出现的位置,修改对应的文件内容去掉 --registry-mirror 参数及其值,并按接下来的步骤进行配置。
如果以上命令没有任何输出,那么就可以在 /etc/docker/daemon.json 中写入如下内容(如果文件不存在请新建该文件):
{
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
]
}
注意,一定要保证该文件符合 json 规范,否则 Docker 将不能启动。
之后重新启动服务。
修改好了重启docker后
docker info
仍然无发看到registry-mirrors。给docker换源失败。
查看:debian服务器已完成安装Gnome,如何开启
# 使开机启动进入图形界面
systemctl set-default graphical.target
reboot后,依旧无法引导进入图形界面(GUI模式)
startx
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE) Server terminated with error (1). Closing log file.
安装VNC
root@Debian11:/etc/default# sudo apt install tigervnc-standalone-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libfile-readbackwards-perl tigervnc-common
The following NEW packages will be installed:
libfile-readbackwards-perl tigervnc-common tigervnc-standalone-server
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 1127 kB of archives.
After this operation, 3148 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.debian.org/debian bullseye/main amd64 libfile-readbackwards-perl all 1.05-2 [12.2 kB]
Get:2 http://ftp.debian.org/debian bullseye/main amd64 tigervnc-common amd64 1.11.0+dfsg-2+deb11u1 [108 kB]
Get:3 http://ftp.debian.org/debian bullseye/main amd64 tigervnc-standalone-server amd64 1.11.0+dfsg-2+deb11u1 [1006 kB]
双双放弃,不用GUI,直接安装:包
https://github.com/conwnet/wpa-dictionary#linux-篇recommended--推荐
sudo apt install aircrack-ng
sudo mkdir /mnt/nas
sudo apt-get install cifs-utils
sudo mount -t cifs //192.168.6.203/KingchuxingSSD512G /mnt/nas -o username=carl,password=******
思路切换:用BT来管理Debian,不需要GUI了
内网面板地址: https://192.168.@@@:36430/8fef4036
username: ******
password: ******
sudo mount -t cifs -o rw,vers=3.0 //192.168.6.203/KingchuxingSSD512G /mnt/nas -o username=carl,password==******
works
debian 跑aircrack-ng
Aircrack-ng无线破解总结
Linux 云服务器aircrack-ng后台跑包并用邮件发送结果
aircrack-ng ./handshake/...cap -w ./pass/1d.txt
手机号字典生成器:可以根据用户需求定制化生成中国各大运营商和指定区域的手机号字典。
https://github.com/asaotomo/makephonedict
疑惑:aircrack-ng跑出来或者没有跑出来,区别在哪里
1. ewsa跑包
2. hashcat
hashcat破解握手包密码
//用aircrack-ng把cap转换成hccap类型数据包
aircrack-ng <input.cap> -J <out.hccap>
//用hashcat破解WPA/PSK密码( -m 2500为破解的模式为WPA/PSK方式)
hashcat -m 2500 testap.hccap pass.txt
3. aircrack-ng [cap包] -w [字典路径]
开启SSH并新增Debian用户
BT面板中 > 安全 > SSH管理 > SSH开关
https://192.168.@@@😡@@/firewall
debian新增一个管理用户
$ sudo adduser {username}
$ sudo passwd {username} #已被adduser默认包含了
将用户添加成为 sudo 用户
$ sudo usermod -aG sudo {username}
删除用户
sudo deluser --remove-home {username}
bt面板 或者 debian 怎么测速?
curl -s https://ghproxy.com/https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3
我们将使用 curl 工具来在线抓取上面使用的 Python 脚本然后直接用 Python 执行脚本。
上面的脚本将会运行脚本输出结果到屏幕上。
carlzeng@Debian11:~$ curl -s https://ghproxy.com/https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3
Retrieving speedtest.net configuration...
Testing from China Unicom (@@@)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by 天津电信 (TianJin) [123.83 km]: 15.133 ms
Testing download speed................................................................................
Download: 253.38 Mbit/s
Testing upload speed......................................................................................................
Upload: 44.48 Mbit/s
carlzeng@Debian11:~$ curl -s https://ghproxy.com/https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3
Retrieving speedtest.net configuration...
Testing from China Unicom (123.118.31.119)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by 天津电信 (TianJin) [123.83 km]: 14.818 ms
Testing download speed................................................................................
Download: 246.83 Mbit/s
Testing upload speed......................................................................................................
Upload: 55.65 Mbit/s
网速优化脚本
wget https://gist.githubusercontent.com/taurusxin/a9fc3ad039c44ab66fca0320045719b0/raw/3906efed227ee14fc5b4ac8eb4eea8855021ef19/optimize.sh && sudo bash optimize.sh
carlzeng@Debian11:~$ curl -s https://ghproxy.com/https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3
Retrieving speedtest.net configuration...
Testing from China Unicom (@@@)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by 天津电信 (TianJin) [123.83 km]: 9.809 ms
Testing download speed................................................................................
Download: 241.16 Mbit/s
Testing upload speed......................................................................................................
Upload: 52.83 Mbit/s
实践证明,这个脚本对于我的环境,没有效果
查看 Linux 系统信息
秋水的 bench.sh 脚本, 可以查看 Linux 系统信息,还可以测试网络带宽及硬盘读写速率。
<img src = 'https://img.laoda.de/i/2022/12/24/iahi9q-2.webp'>
https://www.oldking.net/350.html
wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash