LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Add new user in kickstart file (http://www.linuxquestions.org/questions/linux-general-1/add-new-user-in-kickstart-file-804950/)

prpednek 04-29-2010 06:57 AM

Add new user in kickstart file
 
Hi,
I am currently trying to add a new user on a linux box in the %post section of the kickstart file.

%post --nochroot --log /root/post-install.log
/usr/sbin/useradd -p <ENCRYPTED_PWD> <USER>


The user however doesn't get created after I reboot the box after install. Am I missing anything ?

Any pointers will be appreciated.

Just for info. I am installing RHEL5.4 on a 64 bit box, I know this should not matter, but what the heck!! :)

Thanks and Regards,
Prasad Pednekar.

centosboy 04-29-2010 07:49 AM

Quote:

Originally Posted by prpednek (Post 3951711)
Hi,
I am currently trying to add a new user on a linux box in the %post section of the kickstart file.

%post --nochroot --log /root/post-install.log
/usr/sbin/useradd -p <ENCRYPTED_PWD> <USER>


The user however doesn't get created after I reboot the box after install. Am I missing anything ?

Any pointers will be appreciated.

Just for info. I am installing RHEL5.4 on a 64 bit box, I know this should not matter, but what the heck!! :)

Thanks and Regards,
Prasad Pednekar.


There is an example here...at the bottom of page

http://www.redhat.com/docs/manuals/l...stinstall.html

prpednek 04-29-2010 11:42 AM

Quote:

Originally Posted by centosboy (Post 3951761)
There is an example here...at the bottom of page

http://www.redhat.com/docs/manuals/l...stinstall.html

y

Hi Centosboy,
Thanks for the link, btw I tried the example in the link you had suggested, but it seems the user is still not being created. The command I am using in the post section of the kickstart file should also work, as it too takes all the arguments in a single command.

Really racking my brains on this one!!

I think during installation of RHEL as the filesystem is still mounted on '/mnt/sysimage/' it would not allow to create users !!! This is just a guess though!!!

Guyz, please let me know if anyone has sorted or tried out this.

Regards,
Prasad.

centosboy 05-04-2010 08:10 AM

Quote:

Originally Posted by prpednek (Post 3952053)
y

Hi Centosboy,
Thanks for the link, btw I tried the example in the link you had suggested, but it seems the user is still not being created. The command I am using in the post section of the kickstart file should also work, as it too takes all the arguments in a single command.

Really racking my brains on this one!!

I think during installation of RHEL as the filesystem is still mounted on '/mnt/sysimage/' it would not allow to create users !!! This is just a guess though!!!

Guyz, please let me know if anyone has sorted or tried out this.

Regards,
Prasad.


whilst i have done most things in the kickstart %post section, i have never tried to add a new user directly unless is was part of a script that is run in the %post section.

I am not likely to test this out in the near future either i am afraid

prpednek 05-07-2010 03:51 AM

Quote:

Originally Posted by centosboy (Post 3956807)
whilst i have done most things in the kickstart %post section, i have never tried to add a new user directly unless is was part of a script that is run in the %post section.

I am not likely to test this out in the near future either i am afraid

No issues, got it right at the end. The issue was the --nochroot option I was using with the %post section.


Thanks for your help!!! :)

suraj.sm11 06-23-2014 07:03 AM

creating a user in %post script
 
hi i have just configured a linux trough kickstart scrip i need to write a scrip in %post instaliton to create a user can any one help me by posting the script

---------- Post added 06-23-14 at 05:34 PM ----------

hi i have just configured a linux trough kickstart scrip i need to write a scrip in %post instaliton to create a user can any one help me by posting the script


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