使用guestfish修改QEMU IMAGE的root用户密码
2016-09-19 10:20
861 查看
原文:https://access.redhat.com/discussions/664843
在使用QEMU或在QEMU-KVM时,如果不知道下载的image文件的root用户的密码,可以使用guestfish工具去修改。
Using “guestfish” to change the Password for the root account:
1)You can use guestfish to edit a running system under KVM virtualization
2)You can use “guestfish” to edit the /etc/shadow file and change the root password.
3)Guestfish is an interactive shell that you can use from the command line or from shell scripts to access guest virtual machine file systems. (See example below):
安装guestfish:
yum -y install guestfish//RHEL
yum -y install libguestfs-tools//FEDORA
Import the qcow2 image into KVM. The image will be named something along the lines of: “rhel-guest-image-7.1-20150224.0.x86_64.qcow2”, (as of July 2nd, 2015, the version will of course change over time)
Change the password on the newly imported KVM to get on the pre-built system.
Example steps to change the root password using guestfish:
This set of instructions is for use on the host system that has the kvm RHEL 7 guest.
The syntax is: guestfish –rw -a
(Note, your system may be /dev/vda1, mine was /dev/sda1. Use the ‘list-filesystems’ command)
在使用QEMU或在QEMU-KVM时,如果不知道下载的image文件的root用户的密码,可以使用guestfish工具去修改。
Using “guestfish” to change the Password for the root account:
1)You can use guestfish to edit a running system under KVM virtualization
2)You can use “guestfish” to edit the /etc/shadow file and change the root password.
3)Guestfish is an interactive shell that you can use from the command line or from shell scripts to access guest virtual machine file systems. (See example below):
安装guestfish:
yum -y install guestfish//RHEL
yum -y install libguestfs-tools//FEDORA
Import the qcow2 image into KVM. The image will be named something along the lines of: “rhel-guest-image-7.1-20150224.0.x86_64.qcow2”, (as of July 2nd, 2015, the version will of course change over time)
Change the password on the newly imported KVM to get on the pre-built system.
Example steps to change the root password using guestfish:
This set of instructions is for use on the host system that has the kvm RHEL 7 guest.
The syntax is: guestfish –rw -a
(Note, your system may be /dev/vda1, mine was /dev/sda1. Use the ‘list-filesystems’ command)
root@box1 # guestfish --rw -a ./rhel-guest-image-7.1-20150224.0.x86_64.qcow2 ><fs> run ><fs> list-filesystems ><fs> mount /dev/sda1 / ><fs> vi /etc/shadow ><fs>quit //退出 > //可以在其他命令行下面,使用下面的命令生成新密码 [root@someothersystem ~]# openssl passwd -1 changeme $1$QiSwNHrs$uID6S6qOifSNZKzfXsmQG1
相关文章推荐
- RHEL6与RHEL7使用单用户修改root密码对比
- MySQL 创建用户并授权、 set命令修改用户密码 、使用mysqladmin命令修改root账户密码
- 使用phpMyAdmin修改MySQL数据库root用户密码的方法
- Linux使用单用户模式修改root密码.
- 使用单用户模式修改root密码
- 使用phpMyAdmin修改MySQL数据库root用户密码的方法
- ubuntu下使用、启用、修改root用户密码
- RedHat系统下的网络配置,主机名的修改,进入单用户模式修改root密码和使用SSH远程连接工具
- 使用phpMyAdmin修改MySQL数据库root用户密码
- linux忘记root密码,进入单用户模式修改密码
- Linux单用户模式:修改ROOT密码和grub加密
- 使用mysqladmin修改用户密码的正确方法
- 如何通过suse linux的单用户模式修改root密码
- 给iPhone用户敲响警钟!赶快修改你的root密码!
- MySQL命令行 不同端口登录 执行SQL文件 创建用户 赋予权限 修改root密码
- 如何修改遗失MYSQL的ROOT用户密码
- 如何修改遗失MYSQL的ROOT用户密码
- 如何修改 ubuntu root 用户的初始密码
- 如何修改遗失的MySQL的ROOT用户密码
- 修改root用户的密码