房产小陶 發表於 2023-10-24 12:05:00

Debian初体验之基础设置

<img src="https://www.evernote.com/shard/s122/sh/31348b55-b9f4-4170-84d7-0c32ce32fc4e/bAUDNOvzyZ0EvmU9oLlA3aHF47s8MSmutxc4BRfd059Sqs5WiW0oDsdUVg/deep/0/image.png">
学习J4125软路由里面的Debian 11,包含Debian连接NAS的远程目录
尝试debian启动桌面,安装VNC远程控制,运行aircrack-ng跑包等等...

Debian远程执行,连接NAS的远程目录(装载字典)
<h2 id="如何开启debian的ssh远程管理">如何开启debian的ssh远程管理?</h2>
<p>https://www.xxlxy.com/153.html</p>
<h2 id="如何查看debian的磁盘信息">如何查看debian的磁盘信息</h2>
<p>lsblk</p>
<h2 id="debian-如何启动桌面debian-桌面">debian 如何启动桌面(debian 桌面)</h2>
<p>使用这个工具:tasksel,用来配置/安装桌面系统<br>
选择那个一个桌面?<br>
Gnome一步到位,不想要遇到xface的奔溃机率(踩雷,排雷)</p>
<p>Retrieving file 10 of 1173 (7h 12min 16s remaining)<br>
简直搞笑了</p>
<h3 id="如何debian切换源来加速安装">如何Debian切换源,来加速安装?</h3>
<p>可以通过编辑 /etc/apt/sources.list 文件来更改Debian源<br>
思路:https://blog.fallenbreath.me/zh-CN/2023/pve8-change-sourceslist/</p>
<pre><code># 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
</code></pre>
<p>还是没有生效的感觉不知道是不是PVE的缘故?切换方案:<br>
wget https://ghproxy.com/https://raw.githubusercontent.com/oooldking/script/master/superupdate.sh<br>
bash superupdate.sh cn<br>
bash superupdate.sh 163<br>
bash superupdate.sh aliyun<br>
bash superupdate.sh aws</p>
<p>如果配置的文件不满意,一键还原<br>
bash superupdate.sh restore</p>
<h4 id="docker-里面换源">docker 里面换源</h4>
<p>显然是为了docker里面的系统(比如PHP,Enginx等)在安装插件或者特定包的时候速度加快</p>
<p>思路:https://yeasy.gitbook.io/docker_practice/install/mirror</p>
<pre><code>目前主流 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 将不能启动。
之后重新启动服务。
</code></pre>
<p>修改好了重启docker后<br>
docker info<br>
仍然无发看到registry-mirrors。给docker换源失败。</p>
<h3 id="查看debian服务器已完成安装gnome如何开启">查看:debian服务器已完成安装Gnome,如何开启</h3>
<pre><code class="language-shell"># 使开机启动进入图形界面
systemctl set-default graphical.target
</code></pre>
<p>reboot后,依旧无法引导进入图形界面(GUI模式)</p>
<pre><code class="language-shell">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.

</code></pre>
<h3 id="安装vnc">安装VNC</h3>
<pre><code class="language-shell">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
Get:1 http://ftp.debian.org/debian bullseye/main amd64 libfile-readbackwards-perl all 1.05-2
Get:2 http://ftp.debian.org/debian bullseye/main amd64 tigervnc-common amd64 1.11.0+dfsg-2+deb11u1
Get:3 http://ftp.debian.org/debian bullseye/main amd64 tigervnc-standalone-server amd64 1.11.0+dfsg-2+deb11u1

</code></pre>
<p>双双放弃,不用GUI,直接安装:包<br>
https://github.com/conwnet/wpa-dictionary#linux-篇recommended--推荐</p>
<pre><code class="language-shell">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=******
</code></pre>
<p>思路切换:用BT来管理Debian,不需要GUI了<br>
内网面板地址: https://192.168.@@@:36430/8fef4036<br>
username: ******<br>
password: ******</p>
<pre><code class="language-shell">sudo mount -t cifs -o rw,vers=3.0 //192.168.6.203/KingchuxingSSD512G /mnt/nas -o username=carl,password==******
</code></pre>
<p>works</p>
<p>debian 跑aircrack-ng<br>
Aircrack-ng无线破解总结<br>
Linux 云服务器aircrack-ng后台跑包并用邮件发送结果</p>
<pre><code class="language-shell">aircrack-ng ./handshake/...cap -w ./pass/1d.txt
</code></pre>
<p>手机号字典生成器:可以根据用户需求定制化生成中国各大运营商和指定区域的手机号字典。<br>
https://github.com/asaotomo/makephonedict</p>
<p>疑惑:aircrack-ng跑出来或者没有跑出来,区别在哪里</p>
<pre><code class="language-html">1. ewsa跑包
2. hashcat
    hashcat破解握手包密码
    //用aircrack-ng把cap转换成hccap类型数据包
    aircrack-ng &lt;input.cap&gt; -J &lt;out.hccap&gt;
    //用hashcat破解WPA/PSK密码( -m 2500为破解的模式为WPA/PSK方式)
    hashcat -m 2500 testap.hccap pass.txt
3. aircrack-ng -w [字典路径]
</code></pre>
<h3 id="开启ssh并新增debian用户">开启SSH并新增Debian用户</h3>
<p>BT面板中 &gt; 安全 &gt; SSH管理 &gt; SSH开关<br>
https://192.168.@@@😡@@/firewall</p>
<p>debian新增一个管理用户<br>
$ sudo adduser {username}<br>
$ sudo passwd {username}#已被adduser默认包含了</p>
<p>将用户添加成为 sudo 用户<br>
$ sudo usermod -aG sudo {username}</p>
<p>删除用户<br>
sudo deluser --remove-home {username}</p>
<h3 id="bt面板-或者-debian-怎么测速">bt面板 或者 debian 怎么测速?</h3>
<pre><code class="language-shell">curl -s https://ghproxy.com/https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3
</code></pre>
<p>我们将使用 curl 工具来在线抓取上面使用的 Python 脚本然后直接用 Python 执行脚本。<br>
上面的脚本将会运行脚本输出结果到屏幕上。</p>
<p>3 个方便的命令行网速度测试工具</p>
<pre><code class="language-html">    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) : 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) : 14.818 ms
    Testing download speed................................................................................
    Download: 246.83 Mbit/s
    Testing upload speed......................................................................................................
    Upload: 55.65 Mbit/s
</code></pre>
<h4 id="网速优化脚本">网速优化脚本</h4>
<p>wget https://gist.githubusercontent.com/taurusxin/a9fc3ad039c44ab66fca0320045719b0/raw/3906efed227ee14fc5b4ac8eb4eea8855021ef19/optimize.sh &amp;&amp; sudo bash optimize.sh</p>
<pre><code>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) : 9.809 ms
    Testing download speed................................................................................
    Download: 241.16 Mbit/s
    Testing upload speed......................................................................................................
    Upload: 52.83 Mbit/s
</code></pre>
<p>实践证明,这个脚本对于我的环境,没有效果</p>
<h4 id="查看-linux-系统信息">查看 Linux 系统信息</h4>
<pre><code>秋水的 bench.sh 脚本, 可以查看 Linux 系统信息,还可以测试网络带宽及硬盘读写速率。
&lt;img src = 'https://img.laoda.de/i/2022/12/24/iahi9q-2.webp'&gt;
https://www.oldking.net/350.html
</code></pre>
<pre><code class="language-shell">wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
</code></pre>


</div>
<div id="MySignature" role="contentinfo">
    <p>本文来自博客园,作者:CarlZeng,转载请注明原文链接:https://www.cnblogs.com/backuper/p/17784502.html</p> <hr>
需求沟通链接   扫客服加群:<br> <img src="https://images.cnblogs.com/cnblogs_com/backuper/933606/o_240408031754_%E6%89%AB%E5%AE%A2%E6%9C%8D%E5%8A%A0%E7%BE%A4.png" border="0">
<br><br><br>
来源:https://www.cnblogs.com/backuper/p/17784502.html
頁: [1]
查看完整版本: Debian初体验之基础设置