全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1696|回复: 7

腾讯轻量 Windows 2022 系统 DD Debian 11

[复制链接]
发表于 2022-4-24 14:52:04 | 显示全部楼层 |阅读模式
本帖最后由 zxxx 于 2022-5-2 19:24 编辑

1. 下载 EasyBCD 和 mfslinux

https://sm.myapp.com/original/System/EasyBCD_v2.3.exe
https://mfsbsd.vx.sk/files/iso/mfslinux/mfslinux-0.1.10-f9c75a4.iso

2. 安装 EasyBCD 添加 mfslinux 启动菜单并设置为默认选项





3. 重新启动





4. 通过 SSH 连接

username: root
password: mfsroot

5. 开始 DD
  1. fdisk -l
  2. Disk /dev/vda: 30 GiB, 32212254720 bytes, 62914560 sectors
  3. Units: sectors of 1 * 512 = 512 bytes
  4. Sector size (logical/physical): 512 bytes / 512 bytes
  5. I/O size (minimum/optimal): 512 bytes / 512 bytes
  6. Disklabel type: dos
  7. Disk identifier: 0xf8c3d85e

  8. Device     Boot Start      End  Sectors Size Id Type
  9. /dev/vda1  *     2048 62910463 62908416  30G  7 HPFS/NTFS/exFAT
复制代码


-------------------------------------------------------------------------------------------
使用此镜像无法登陆,必须通过VNC修改密码才行
https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.raw
-------------------------------------------------------------------------------------------

  1. wget -O- "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.raw" | dd of=/dev/vda
复制代码

Download completed (2147483648 bytes)
4189053+9690 records in
4189053+9690 records out


6. mount

  1. fdisk -l
  2. GPT PMBR size mismatch (4194303 != 62914559) will be corrected by write. <=== 错误?

  3. The backup GPT table is not on the end of the device.
  4. Disk /dev/vda: 30 GiB, 32212254720 bytes, 62914560 sectors
  5. Units: sectors of 1 * 512 = 512 bytes
  6. Sector size (logical/physical): 512 bytes / 512 bytes
  7. I/O size (minimum/optimal): 512 bytes / 512 bytes
  8. Disklabel type: gpt
  9. Disk identifier: 2AC9A341-47CF-F740-B3FA-A9FF9D45F89A

  10. Device      Start     End Sectors  Size Type
  11. /dev/vda1  262144 4194270 3932127  1.9G Linux filesystem
  12. /dev/vda14   2048    8191    6144    3M BIOS boot
  13. /dev/vda15   8192  262143  253952  124M EFI System

  14. Partition table entries are not in disk order.
复制代码


无法 mount

  1. mkdir /mnt/vda1
  2. mount /dev/vda1 /mnt/vda1

  3. NTFS signature is missing.
  4. Failed to mount '/dev/vda1': Invalid argument
  5. The device '/dev/vda1' doesn't seem to have a valid NTFS.
  6. Maybe the wrong device is used? Or the whole disk instead of a
  7. partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
  8. mount: mounting /dev/vda1 on /mnt/vda1 failed: Invalid argument
复制代码


修复

  1. fdisk /dev/vda

  2. Welcome to fdisk (util-linux 2.36.1).
  3. Changes will remain in memory only, until you decide to write them.
  4. Be careful before using the write command.

  5. GPT PMBR size mismatch (4194303 != 62914559) will be corrected by write.
  6. The backup GPT table is not on the end of the device. This problem will be corrected by write.

  7. Command (m for help): w

  8. The partition table has been altered.
  9. Calling ioctl() to re-read partition table.
  10. Syncing disks.
复制代码


重新 mount

  1. mount /dev/vda1 /mnt/vda1
  2. ls /mnt/vda1/usr/local
复制代码

bin      etc      games    include  lib      man      sbin     share    src


此时并没有 /usr/local/qcloud 这个文件夹

7. 配置 SSH

允许 root 使用密码登录

  1. sed -i 's/.*PermitRootLogin.*/PermitRootLogin yes/' /mnt/vda1/etc/ssh/sshd_config
  2. sed -i 's/.*PasswordAuthentication.*/PasswordAuthentication yes/' /mnt/vda1/etc/ssh/sshd_config
复制代码


修改 root 密码

  1. chroot /mnt/vda1/

  2. passwd root
  3. ********
  4. ********

  5. passwd -S root
  6. root P 04/24/2022 0 99999 7 -1

  7. cat /etc/shadow | grep root
  8. root:$y$j9T$onpHR5WOJnsR2/G8ChkaH0$2vtxjM/PIMbULsMWQnfPwF/TKLT8gPDFjyESjlRz2E4:19106:0:99999:7:::

  9. exit
  10. umount /mnt/vda1/
复制代码


8. 重启到 Debian 11

  1. reboot
复制代码
 楼主| 发表于 2022-4-24 14:52:05 | 显示全部楼层
本帖最后由 zxxx 于 2022-4-24 14:50 编辑

重启之后无法使用设置的 root 的密码登录。

通过控制面板【一键免密登录】登录,发现密码被修改了

重启之前

  1. cat /etc/shadow | grep root
  2. root:$y$j9T$onpHR5WOJnsR2/G8ChkaH0$2vtxjM/PIMbULsMWQnfPwF/TKLT8gPDFjyESjlRz2E4:19106:0:99999:7:::
复制代码


重启之后

  1. sudo cat /etc/shadow | grep root
  2. root:$1$SCHOoGBY$qPO8vlLAXHuELwt.aEhDu0:19106:0:99999:7:::
复制代码


同时多出来一个文件夹 /usr/local/qcloud

  1. ls /usr/local
  2. bin  etc  games  include  lib  man  qcloud  sbin  share  src
复制代码


尝试重新设置 root 密码

  1. sudo passwd root
  2. New password:
  3. Retype new password:
  4. passwd: password updated successfully

  5. sudo cat /etc/shadow | grep root
  6. root:$y$j9T$T76Q00rHl.AWo4XebXcPB/$wBLwqUl5XhvjUAGQFx/NLhcz5zHrVEU0oTr9uIZEJM3:19106:0:99999:7:::
复制代码


然后就可以顺利的使用新密码登录了。


请教为什么不能使用自己设置的root密码登录呢?
 楼主| 发表于 2022-4-25 07:33:54 | 显示全部楼层
本帖最后由 zxxx 于 2022-5-2 19:29 编辑

使用 nocloud 映像可以直接登录了,并且也没有 /usr/local/qcloud 文件夹

https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-nocloud-amd64.raw

控制面板看不到cpu和内存数据




  1. wget -O- "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-nocloud-amd64.raw" | dd of=/dev/vda

  2. fdisk /dev/vda << EOF
  3. w
  4. q
  5. EOF

  6. mkdir /mnt/vda1 && mount /dev/vda1 /mnt/vda1 && chroot /mnt/vda1

  7. ssh-keygen -A && \
  8. sed -i 's/.*PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config && \
  9. sed -i 's/.*PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
  10. passwd root
  11. ********
  12. ********

  13. reboot
复制代码
表妹 该用户已被删除
发表于 2022-4-25 08:04:52 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2022-5-2 19:06:59 | 显示全部楼层
大佬、阿里云 香港  用你的办法DD了debian   
8. 重启到 Debian 11
做到这一步 重启后 、无法远程连接、然后我使用VNC  可以登录使用。

连接VNC后 登录ROOT
使用
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 10 -v 64 -p "abcabc" -port "22"

这个脚本再次DD后,就可以正常使用了。

感谢大佬
 楼主| 发表于 2022-5-2 19:14:49 | 显示全部楼层
强迫症专家 发表于 2022-5-2 19:06
大佬、阿里云 香港  用你的办法DD了debian   
8. 重启到 Debian 11
做到这一步 重启后 、无法远程连接、然 ...

开始我也是无法登录,原来是搞错镜像了。

  1. wget -O- "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-nocloud-amd64.raw" | dd of=/dev/vda

  2. fdisk /dev/vda << EOF
  3. w
  4. q
  5. EOF

  6. mkdir /mnt/vda1 && mount /dev/vda1 /mnt/vda1 && chroot /mnt/vda1

  7. ssh-keygen -A && \
  8. sed -i 's/.*PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config && \
  9. sed -i 's/.*PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
  10. passwd root
  11. ********
  12. ********

  13. reboot
复制代码
发表于 2022-5-2 19:19:15 | 显示全部楼层
你是指这个地方的镜像不对吗?

wget -O- "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.raw" | dd of=/dev/vda
复制代码

Download completed (2147483648 bytes)
4189053+9690 records in
4189053+9690 records out


是的话修改下你最上面的帖子呢。免得别人也遇到这样的问题。
 楼主| 发表于 2022-5-2 19:28:48 | 显示全部楼层
强迫症专家 发表于 2022-5-2 19:19
你是指这个地方的镜像不对吗?

wget -O- "https://cloud.debian.org/images/cloud/bullseye/latest/debian ...

已经修改了。你帮我把蓝色提示的帖子顶上去,谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-9-20 12:20 , Processed in 0.064529 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表