|
|
首先我们遇到问题,自己创建的镜像总是不够完善,但是下载的镜像又不知道密码,很麻烦,就只能想着怎么样才能解决这个问题,到google和百度搜索下,照着这个方式做了,提示用guestfish方式:
' s' _; G; G' b% x$ A[root@controller1 ~]# guestfish --rw -a /usr/src/ubuntu-20.04-server.raw * d- }2 j; k2 t% k
Welcome to guestfish, the guest filesystem shell for: ^1 G/ ] P, L8 h; ]
editing virtual machine filesystems and disk images.9 [3 D9 N9 S5 c, i% g$ V- S
Type: ‘help’ for help on commands
& l& t* f, ~0 h6 x ‘man’ to read the manual
& x8 J, h0 r; N2 B7 z1 \& F ‘quit’ to quit the shell
5 N% G/ v, s0 E2 U6 P$ f* s执行run命令:0 @, X$ }/ a* E. q5 r$ f) T9 C+ e
><fs> run ; s, W9 x. Q4 R# _) {
◓ 75% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00. F, V7 ]8 }1 z; @
><fs>
3 I" D$ D# z7 N8 ]6 z接下来执行list-filesystems
8 u3 J5 N. E/ |8 F><fs> list-filesystems $ _$ G+ }8 n% s1 `
/dev/sda1: ext4
3 M5 O! ?* w7 W/dev/sda14: unknown* Y* e/ D( Z! y+ p2 F" a
/dev/sda15: vfat
# h8 g5 ~' \3 s) H( S) L$ o0 p. O! `) k) h
><fs> mount /dev/sda1 /
4 d5 b3 j# e; k><fs> vi /etc/shadow ( V( i1 G! m" K8 e% k6 C
><fs> vi /etc/shadow + I) n- a9 f6 ?: r/ a" B2 I8 Z# Z* j
root:$1$sqYWS/Ap$v9rBnJlIgUpPPXnWfluVX1:18960:0:99999:7:::
7 p4 `$ l- U% o><fs> ' ?- _4 a& N4 V: x
><fs> 5 G) @7 s5 [/ \8 ~
><fs> quit2 j9 C E d" m X+ R( Z. N D
[root@controller1 ~]#
' Z1 L+ E5 S6 o3 W- S* _& h1 B! V' I- p& t: C: x
[root@controller1 src]# openssl passwd -1 'linux123!@#'
+ e u& P+ v0 i0 q" t# c" \$1$sqYWS/Ap$v9rBnJlIgUpPPXnWfluVX16 b3 O! e3 `% p j" i
4 n1 Z, J$ C' K
* D3 ~% K9 n2 N& @% D
|
|