ssh-keygen -t rsa -C "xxx@domain" # 将生成的密钥放到相应的位置 mkdir /home/username/.ssh touch /home/username/.ssh/authorized_keys # Enter file in which to save the key (/root/.ssh/id_rsa):/home/username/.ssh/id_rsa cd /home/username/.ssh cat id_rsa.pub > authorized_keys # 修改权限 cd .. chown -R username:username .ssh chmod -R 700 .ssh chmod 600 .ssh/authorized_keys登陆的用户名为:username 登陆的密钥为/home/username/.ssh/id_rsa的内容
标签: linux
Linux梭哈
- acme.sh
- btpanel-x64
- docker-x64
- docker-x64-firefox
- docker-x64-jellyfin
- docker-x64-portainer
- docker-x64-qbittorrent
- nfs-x64
- vscode-server-x64
- xray-x64
- zerotier-x64
- btpanel-x64
- aarch64运行Windows
- docker-aarch64
- docker-aarch64-firefox
- docker-aarch64-portainer
- docker-aarch64-windows
- nginx-aarch64
- novnc-aarch64
- Oracle Cloud 还原引导盘
- oracle-vm-virtualbox-aarch64
- qemu-aarch64
- vncserver-aarch64
- wine-aarch64
- docker-aarch64-pandora-next
Linux磁盘扩容
[MD]
1. 在OCI后台把引导卷从40GB调整为100GB
2.在SSH操作
2.1 lsblk
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 40G 0 disk
├─sda2 8:2 0 8G 0 part [SWAP]
├─sda3 8:3 0 31.5G 0 part /
└─sda1 8:1 0 512M 0 part /boot/efi
可以看到/
对应的分区是sda3
2.2 dd 重新扫描磁盘
# dd iflag=direct if=/dev/sda of=/dev/null count=1
# echo "1" | tee /sys/class/block/sda/device/rescan
1
2.3 查询系统类型
# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda2 swap c20ab25a-797e-4c88-b9b4-bbc5e279a88c [SWAP]
├─sda3 xfs e8399f69-1f3e-4713-afca-f2b9c8f7bbc6 /
└─sda1 vfat 9BE4-DC71 /boot/efi
2.4 安装扩容软件
# yum install cloud-utils-growpart
# yum install xfsprogs
sda3
的系统类型为xfs
,扩容需要安装xfsprogs
2.5 growpart对应的分区
# growpart /dev/sda 3
CHANGED:partition=1 start=...
2.6 扩展分区
# xfs_growfs /dev/sda3
2.7 验证
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
├─sda2 8:2 0 8G 0 part [SWAP]
├─sda3 8:3 0 91.5G 0 part /
└─sda1 8:1 0 512M 0 part /boot/efi
其他问题:
- 报错:Couldn’t find valid filesystem superblock.,
resize2fs
替换为xfs_growfs
- 报错:Warning: the kernel is still using the old partition table.The new table will be used at the next reboot.,运行
partprobe
重新读取分区表
参考链接:
1.https://blog.csdn.net/shitian0811/article/details/104005374
2.https://docs.oracle.com/en-us/Content/Block/Tasks/rescanningdisk.htm
portainer安装命令
cd / mkdir data docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /data:/data --restart=always --name portainer 6053537/portainer-ce:latest
Linux学习
本文最后更新于(2023-1-10 09:36:10),链接可能失效,内容可能难以复现。请注意甄别。
鸟哥的Linux私房菜
本站的Linux教程已经撰写完成,点击