<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<channel>
<title>磊哥|个人博客 - debian</title>
<link>https://vps.668618.xyz/index.php/tag/debian/</link>
<atom:link href="https://vps.668618.xyz/index.php/feed/tag/debian/" rel="self" type="application/rss+xml" />
<language>zh-CN</language>
<description></description>
<lastBuildDate>Sat, 07 Dec 2024 18:55:00 +0800</lastBuildDate>
<pubDate>Sat, 07 Dec 2024 18:55:00 +0800</pubDate>
<item>
<title>Debian挂载gpt（guid）格式的硬盘</title>
<link>https://vps.668618.xyz/index.php/archives/103/</link>
<guid>https://vps.668618.xyz/index.php/archives/103/</guid>
<pubDate>Sat, 07 Dec 2024 18:55:00 +0800</pubDate>
<dc:creator>admin</dc:creator>
<description><![CDATA[首先使用 fdisk -l 命令查看未挂载的硬盘名称，此处以硬盘名Disk /dev/vdb为例1.安装partedapt-get install parted gdisk2.使用 parted...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>首先使用 fdisk -l 命令查看未挂载的硬盘名称，此处以硬盘名Disk /dev/vdb为例</p><p>1.安装parted</p><pre><code>apt-get install parted gdisk</code></pre><p>2.使用 parted 创建GPT分区表（如果还没有）</p><pre><code>parted /dev/vdb mklabel gpt</code></pre><p>3.使用 parted 创建分区</p><pre><code>parted -a optimal /dev/vdb mkpart primary ext4 0% 100%</code></pre><p>4.格式化分区为ext4</p><pre><code>mkfs.ext4 /dev/vdb1</code></pre><p>5.获取分区的UUID</p><pre><code>blkid /dev/vdb1</code></pre><p>6.编辑 /etc/fstab 以UUID方式挂载</p><pre><code>nano /etc/fstab</code></pre><p>7.添加到最后一行，保存退出</p><pre><code>UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /mnt/data ext4 defaults 0 2</code></pre><p>8.创建挂载点</p><pre><code>mkdir /mnt/data</code></pre><p>9.挂载</p><pre><code>mount -a</code></pre><p>10.验证有没有新的分区</p><pre><code>df -h</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://vps.668618.xyz/index.php/archives/103/#comments</comments>
<wfw:commentRss>https://vps.668618.xyz/index.php/feed/tag/debian/</wfw:commentRss>
</item>
<item>
<title>Debian/Ubuntu 手动添加 Swap 分区</title>
<link>https://vps.668618.xyz/index.php/archives/47/</link>
<guid>https://vps.668618.xyz/index.php/archives/47/</guid>
<pubDate>Thu, 09 May 2024 00:58:00 +0800</pubDate>
<dc:creator>admin</dc:creator>
<description><![CDATA[本文将指导如何在 Debian 11 和 Ubuntu 22.04 下手工添加 Swap 分区。准备工作首先，检查你的系统是否已经有 Swap 分区：swapon -s或free -m如果没有返...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>本文将指导如何在 Debian 11 和 Ubuntu 22.04 下手工添加 Swap 分区。</p><p>准备工作<br>首先，检查你的系统是否已经有 Swap 分区：</p><pre><code>swapon -s
</code></pre><p>或</p><pre><code>free -m
</code></pre><p>如果没有返回结果或者 free -m 中 Swap 一列数值是 0，则表示你的系统没有 Swap 分区。</p><p>创建 SWAP 分区<br>我们可以使用 fallocate 命令创建一个 1GB 大小的 Swap 分区：</p><pre><code>fallocate -l 1G /swapfile
</code></pre><p>如果这个命令无法使用，请安装 util-linux 包：</p><pre><code>apt install util-linux
</code></pre><p>然后设置这个文件的权限：</p><pre><code>chmod 600 /swapfile
</code></pre><p>然后激活 SWAP 分区（第一步）</p><pre><code>mkswap /swapfile
</code></pre><p>然后激活 SWAP 分区（第二步）</p><pre><code>swapon /swapfile
</code></pre><p>此时，你可以使用 swapon -s 或 free -m 命令查看 Swap 分区是否已经激活。</p><p>安装vim</p><pre><code>apt install vim
</code></pre><p>设置开机自启<br>我们需要编辑 /etc/fstab 这个文件</p><pre><code>vim /etc/fstab
</code></pre><p>加入下面的内容即可：</p><pre><code>echo &quot;/swapfile swap swap defaults 0 0&quot; &gt;&gt; /etc/fstab
</code></pre><p>打开文件后按i键进入编辑模式，然后复制上边的命令到最后一行，然后按英文冒号，输入wq,按enter保存退出</p><p>大功告成，使用 free -m 命令查看 Swap 分区是否正确：<br><img src="https://vps.668618.xyz/usr/uploads/2024/05/3927551533.png" alt="2024-05-08T17:00:02.png" title="2024-05-08T17:00:02.png"></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://vps.668618.xyz/index.php/archives/47/#comments</comments>
<wfw:commentRss>https://vps.668618.xyz/index.php/feed/tag/debian/</wfw:commentRss>
</item>
<item>
<title>debian系统添加/禁用ipv6</title>
<link>https://vps.668618.xyz/index.php/archives/41/</link>
<guid>https://vps.668618.xyz/index.php/archives/41/</guid>
<pubDate>Wed, 27 Mar 2024 01:05:00 +0800</pubDate>
<dc:creator>admin</dc:creator>
<description><![CDATA[首先确保你的服务商给你分配了IPV6地址，然后按照下面的步骤操作1.安装网络工具 apt install net-tools2.查看网卡信息命令ifconfig会输出类似下边这样的内容：上面，网...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>首先确保你的服务商给你分配了IPV6地址，然后按照下面的步骤操作</p><p>1.安装网络工具</p><pre><code> apt install net-tools</code></pre><p>2.查看网卡信息命令</p><pre><code>ifconfig</code></pre><p>会输出类似下边这样的内容：<br><img src="https://vps.668618.xyz/usr/uploads/2024/03/2486585394.png" alt="2024-03-26T17:19:45.png" title="2024-03-26T17:19:45.png"></p><p>上面，网卡名：ens3；natmask 后面是掩码；inet 后面是 IPv4 IP；inet6 后面是 IPv6 IP<br>注意，每台vps都不一样，注意区分</p><p>3.查看 IPv4 网关</p><pre><code>ip route show dev ens3</code></pre><p>4.查看 IPV6 网关，default via后边的那一串数字就是，不包含再之后的字母</p><pre><code>ip -6 route show dev ens3</code></pre><p>5.安装vim</p><pre><code>apt install vim</code></pre><p>6.编辑网卡文件</p><pre><code>vim /etc/network/interfaces</code></pre><p>7.进入文档页后，按 i 键进入编辑，然后手动复制命令到下一行</p><pre><code>iface eth0 inet6 static
address 你的公网IPV6地址
netmask 64
gateway 你的IPV6网关
autoconf 0
dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888</code></pre><p>8.复制后，英文输入状态按ESC键，然后输入 :wq，按回车，自动保存退出<br>9.重启网络</p><pre><code>/etc/init.d/networking restart</code></pre><p>10.重启服务器</p><pre><code>reboot</code></pre><p>11.测试是否成功，能ping通代表添加完成</p><pre><code>ping6 google.com</code></pre><p>AWS 添加的示例</p><p>iface eth0 inet6 static<br>address 2600:1f11:305:e800:315b:cfc8:5b55:322c<br>netmask 64<br>gateway fe80::cd:79ff:fefd:9697<br>autoconf 0<br>dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888</p><p>Debian11禁用ipv6命令</p><pre><code>echo &quot;net.ipv6.conf.all.disable_ipv6 = 1&quot; &gt;&gt; /etc/sysctl.conf
echo &quot;net.ipv6.conf.default.disable_ipv6 = 1&quot; &gt;&gt; /etc/sysctl.conf
sysctl -p</code></pre><p>这将在<code>/etc/sysctl.conf</code>文件中添加两行，然后自动使用<code>sysctl -p</code>命令使更改生效。注意，禁用IPv6可能会影响某些应用程序的功能，请谨慎操作。</p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://vps.668618.xyz/index.php/archives/41/#comments</comments>
<wfw:commentRss>https://vps.668618.xyz/index.php/feed/tag/debian/</wfw:commentRss>
</item>
<item>
<title>安装wegt</title>
<link>https://vps.668618.xyz/index.php/archives/33/</link>
<guid>https://vps.668618.xyz/index.php/archives/33/</guid>
<pubDate>Sat, 09 Mar 2024 00:23:00 +0800</pubDate>
<dc:creator>admin</dc:creator>
<description><![CDATA[centosyum -y install wgetdebian/ubuntuapt-get install wget要确认安装了wget工具，请运行命令:dpkg -l | grep wget]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>centos</p><pre><code>yum -y install wget</code></pre><p>debian/ubuntu</p><pre><code>apt-get install wget</code></pre><p>要确认安装了wget工具，请运行命令:</p><pre><code>dpkg -l | grep wget</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://vps.668618.xyz/index.php/archives/33/#comments</comments>
<wfw:commentRss>https://vps.668618.xyz/index.php/feed/tag/debian/</wfw:commentRss>
</item>
<item>
<title>debian关闭防火墙打开所有端口</title>
<link>https://vps.668618.xyz/index.php/archives/28/</link>
<guid>https://vps.668618.xyz/index.php/archives/28/</guid>
<pubDate>Fri, 01 Mar 2024 01:49:00 +0800</pubDate>
<dc:creator>admin</dc:creator>
<description><![CDATA[安装防火墙apt-get install ufw关闭防火墙ufw disable开放所有端口sudo ufw allow from any to any port 1:65535 proto t...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>安装防火墙</p><pre><code>apt-get install ufw</code></pre><p>关闭防火墙</p><pre><code>ufw disable</code></pre><p>开放所有端口</p><pre><code>sudo ufw allow from any to any port 1:65535 proto tcp</code></pre><pre><code>sudo ufw allow from any to any port 1:65535 proto udp</code></pre><p>(附)或者使用iptables命令也可以关闭debian防火墙</p><pre><code>sudo iptables -F
sudo iptables -X
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://vps.668618.xyz/index.php/archives/28/#comments</comments>
<wfw:commentRss>https://vps.668618.xyz/index.php/feed/tag/debian/</wfw:commentRss>
</item>
<item>
<title>Debian 10/11开机后部署基础命令</title>
<link>https://vps.668618.xyz/index.php/archives/12/</link>
<guid>https://vps.668618.xyz/index.php/archives/12/</guid>
<pubDate>Thu, 29 Feb 2024 22:30:00 +0800</pubDate>
<dc:creator>admin</dc:creator>
<description><![CDATA[安装并更新环境apt update -y &amp;&amp; apt dist-upgrade -y &amp;&amp; apt install -y curl &amp;&amp; apt...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>安装并更新环境</p><pre><code>apt update -y &amp;&amp; apt dist-upgrade -y &amp;&amp; apt install -y curl &amp;&amp; apt install -y socat</code></pre><pre><code>apt install curl wget -y</code></pre><pre><code>apt-get install -y xz-utils openssl gawk file wget screen &amp;&amp; screen -S os</code></pre><p>更改SSH终端语言为中文（可选）</p><pre><code>wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/LocaleCN/master/LocaleCN.sh &amp;&amp; bash LocaleCN.sh</code></pre><p>更改服务器时区为上海（可选）</p><pre><code>timedatectl set-timezone 'Asia/Shanghai'</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://vps.668618.xyz/index.php/archives/12/#comments</comments>
<wfw:commentRss>https://vps.668618.xyz/index.php/feed/tag/debian/</wfw:commentRss>
</item>
</channel>
</rss>