LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-30-2010, 12:47 PM   #1
jonnytabpni
Member
 
Registered: Sep 2008
Posts: 68

Rep: Reputation: 16
Create Linux Users on mounted disk image


Hi Everyone,

I'm currently in the middle of developing an automatic system which can provision Linux VMs automatically.

Let's say I have a disk image which has a Linux distro installed on it. How would I change the root password on that, without having to boot the OS?

It would be nice if I could just simply run passwd with some switch to point to the /etc/shadow file on the (mounted) VM disk image..

Any help would be appreciated

Thanks
 
Old 09-30-2010, 01:34 PM   #2
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 542

Rep: Reputation: 79
Hi jonnytabpni,

You can use chroot for that.

Ex:

your image is mounted in /mnt/myImage
Code:
chroot /mnt/myImage
passwd root
exit
That should do the trick.

Last edited by angel115; 09-30-2010 at 01:36 PM.
 
1 members found this post helpful.
Old 09-30-2010, 05:07 PM   #3
jonnytabpni
Member
 
Registered: Sep 2008
Posts: 68

Original Poster
Rep: Reputation: 16
angel115, Thanks!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create/boot a ram image from a disk? weshutchins Linux - Newbie 4 04-06-2010 07:20 PM
[SOLVED] How do I create a loopback disk image? judoka Linux - Newbie 10 08-18-2009 07:53 AM
Create a mountable disk image of Windows partition tnine9 Linux - Desktop 3 08-10-2008 07:13 PM
qemu create disk image kpachopoulos Linux - General 3 11-29-2005 10:49 AM
How to create disk image with Linux? zaoka Linux - Software 3 07-14-2005 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration