From simpsonar77 at gmail.com Mon Jun 28 20:06:50 2021 From: simpsonar77 at gmail.com (Andrew Simpson) Date: Mon, 28 Jun 2021 16:06:50 -0400 Subject: Require user account setup during kickstart install before %post? Message-ID: Is it possible to require/force a user to enter in their user account information before the install gets to the %post section via the graphical installer? I need everything else to be automated, except this step, and need to modify that user's groups in the "post" section. It appears that if nothing is entered via the GUI during install, that the install will complete without it. (root is setup as part of the ks). -------------- next part -------------- An HTML attachment was scrubbed... URL: From chavanpushpendra at gmail.com Tue Jun 29 05:13:33 2021 From: chavanpushpendra at gmail.com (Pushpendra Chavan) Date: Tue, 29 Jun 2021 10:43:33 +0530 Subject: Require user account setup during kickstart install before %post? In-Reply-To: References: Message-ID: Hi, You can write a %pre script which would force ask user to enter username and password or any other information and then write that information down in a /tmp/somefile.txt Then continue the installation, and in %post section, first %post would be with --nochroot where it will copy that text file to /mnt/sysimage/somelocation And then from that location, it would utilize that information and act accordingly. You can write the %pre section as follows. I have tested this on RHEL7 %pre exec < /dev/tty7 > /dev/tty7 chvt 7 echo "Enter Manual Information in given format" read MYINFO echo $MYINFO >/tmp/test chvt 1 %end KICKSTART BODY %post --nochroot mv /tmp/test /mnt/sysimage/tmp/test %end %post # Use /tmp/test to perform %post actions %end *Thanks,* *Pushpendra Chavan.* On Tue, Jun 29, 2021 at 1:39 AM Andrew Simpson wrote: > Is it possible to require/force a user to enter in their user account > information before the install gets to the %post section via the graphical > installer? I need everything else to be automated, except this step, and > need to modify that user's groups in the "post" section. It appears that > if nothing is entered via the GUI during install, that the install will > complete without it. (root is setup as part of the ks). > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://listman.redhat.com/mailman/listinfo/kickstart-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From simpsonar77 at gmail.com Tue Jun 29 13:55:17 2021 From: simpsonar77 at gmail.com (Andrew Simpson) Date: Tue, 29 Jun 2021 09:55:17 -0400 Subject: Require user account setup during kickstart install before %post? In-Reply-To: References: Message-ID: Thank you for that. I have done something similar, but all in the %post. I was hoping that there was a way to force the user to use the UI to enter username and password, though. I suppose moving this to %pre would then allow me to "set" the user account in the main kickstart section using 'user ---name .....' On Tue, Jun 29, 2021 at 1:15 AM Pushpendra Chavan < chavanpushpendra at gmail.com> wrote: > Hi, > > You can write a %pre script which would force ask user to enter username > and password or any other information and then write that information down > in a /tmp/somefile.txt > Then continue the installation, and in %post section, first %post would be > with --nochroot where it will copy that text file to > /mnt/sysimage/somelocation > And then from that location, it would utilize that information and act > accordingly. > > You can write the %pre section as follows. I have tested this on RHEL7 > > %pre > exec < /dev/tty7 > /dev/tty7 > chvt 7 > echo "Enter Manual Information in given format" > read MYINFO > echo $MYINFO >/tmp/test > chvt 1 > > %end > > KICKSTART BODY > > > %post --nochroot > > mv /tmp/test /mnt/sysimage/tmp/test > > %end > > > %post > > # Use /tmp/test to perform %post actions > > %end > > > > *Thanks,* > *Pushpendra Chavan.* > > > > On Tue, Jun 29, 2021 at 1:39 AM Andrew Simpson > wrote: > >> Is it possible to require/force a user to enter in their user account >> information before the install gets to the %post section via the graphical >> installer? I need everything else to be automated, except this step, and >> need to modify that user's groups in the "post" section. It appears that >> if nothing is entered via the GUI during install, that the install will >> complete without it. (root is setup as part of the ks). >> _______________________________________________ >> Kickstart-list mailing list >> Kickstart-list at redhat.com >> https://listman.redhat.com/mailman/listinfo/kickstart-list > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://listman.redhat.com/mailman/listinfo/kickstart-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From chavanpushpendra at gmail.com Wed Jun 30 02:49:40 2021 From: chavanpushpendra at gmail.com (Pushpendra Chavan) Date: Wed, 30 Jun 2021 08:19:40 +0530 Subject: Require user account setup during kickstart install before %post? In-Reply-To: References: Message-ID: Hi, You can do it as well. Just create that file in %pre section and then instead of using it in %post, use the following line in ks %include /path/to/file Please make sure you have the file /path/to/file written in appropriate Kickstart format. %pre section can be utilized to properly format it with user entered username and password. Regards, Pushpendra Chavan. On Tue, Jun 29, 2021, 7:27 PM Andrew Simpson wrote: > Thank you for that. I have done something similar, but all in the %post. > I was hoping that there was a way to force the user to use the UI to enter > username and password, though. > > I suppose moving this to %pre would then allow me to "set" the user > account in the main kickstart section using 'user ---name .....' > > > > On Tue, Jun 29, 2021 at 1:15 AM Pushpendra Chavan < > chavanpushpendra at gmail.com> wrote: > >> Hi, >> >> You can write a %pre script which would force ask user to enter username >> and password or any other information and then write that information down >> in a /tmp/somefile.txt >> Then continue the installation, and in %post section, first %post would >> be with --nochroot where it will copy that text file to >> /mnt/sysimage/somelocation >> And then from that location, it would utilize that information and act >> accordingly. >> >> You can write the %pre section as follows. I have tested this on RHEL7 >> >> %pre >> exec < /dev/tty7 > /dev/tty7 >> chvt 7 >> echo "Enter Manual Information in given format" >> read MYINFO >> echo $MYINFO >/tmp/test >> chvt 1 >> >> %end >> >> KICKSTART BODY >> >> >> %post --nochroot >> >> mv /tmp/test /mnt/sysimage/tmp/test >> >> %end >> >> >> %post >> >> # Use /tmp/test to perform %post actions >> >> %end >> >> >> >> *Thanks,* >> *Pushpendra Chavan.* >> >> >> >> On Tue, Jun 29, 2021 at 1:39 AM Andrew Simpson >> wrote: >> >>> Is it possible to require/force a user to enter in their user account >>> information before the install gets to the %post section via the graphical >>> installer? I need everything else to be automated, except this step, and >>> need to modify that user's groups in the "post" section. It appears that >>> if nothing is entered via the GUI during install, that the install will >>> complete without it. (root is setup as part of the ks). >>> _______________________________________________ >>> Kickstart-list mailing list >>> Kickstart-list at redhat.com >>> https://listman.redhat.com/mailman/listinfo/kickstart-list >> >> _______________________________________________ >> Kickstart-list mailing list >> Kickstart-list at redhat.com >> https://listman.redhat.com/mailman/listinfo/kickstart-list > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://listman.redhat.com/mailman/listinfo/kickstart-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From chavanpushpendra at gmail.com Wed Jun 30 08:56:12 2021 From: chavanpushpendra at gmail.com (Pushpendra Chavan) Date: Wed, 30 Jun 2021 14:26:12 +0530 Subject: Require user account setup during kickstart install before %post? In-Reply-To: References: Message-ID: I tried looking at kickstart documentation and confirmed that the user parameter in kickstart body is actually an optional parameter which means, if you don't provide it, kickstart body won't ask you to enter or won't stop. In fact, the option to add a user isn't grayed out during kickstart in GUI if you don't have user param in kickstart. In case someone has access to the system physically, one can add any user and even make that user a part of the wheel group, so many actually create a test user with --lock option so that nobody could utilize adding a user during kickstart. The best way to deal with this is to create a text file in %pre and utilize that file using the%include option in the kickstart body. *Thanks,* *Pushpendra Chavan.* On Wed, Jun 30, 2021 at 8:19 AM Pushpendra Chavan < chavanpushpendra at gmail.com> wrote: > Hi, > > You can do it as well. > > Just create that file in %pre section and then instead of using it in > %post, use the following line in ks > > %include /path/to/file > > Please make sure you have the file /path/to/file written in appropriate > Kickstart format. > > %pre section can be utilized to properly format it with user entered > username and password. > > Regards, > Pushpendra Chavan. > > > > On Tue, Jun 29, 2021, 7:27 PM Andrew Simpson > wrote: > >> Thank you for that. I have done something similar, but all in the >> %post. I was hoping that there was a way to force the user to use the UI >> to enter username and password, though. >> >> I suppose moving this to %pre would then allow me to "set" the user >> account in the main kickstart section using 'user ---name .....' >> >> >> >> On Tue, Jun 29, 2021 at 1:15 AM Pushpendra Chavan < >> chavanpushpendra at gmail.com> wrote: >> >>> Hi, >>> >>> You can write a %pre script which would force ask user to enter username >>> and password or any other information and then write that information down >>> in a /tmp/somefile.txt >>> Then continue the installation, and in %post section, first %post would >>> be with --nochroot where it will copy that text file to >>> /mnt/sysimage/somelocation >>> And then from that location, it would utilize that information and act >>> accordingly. >>> >>> You can write the %pre section as follows. I have tested this on RHEL7 >>> >>> %pre >>> exec < /dev/tty7 > /dev/tty7 >>> chvt 7 >>> echo "Enter Manual Information in given format" >>> read MYINFO >>> echo $MYINFO >/tmp/test >>> chvt 1 >>> >>> %end >>> >>> KICKSTART BODY >>> >>> >>> %post --nochroot >>> >>> mv /tmp/test /mnt/sysimage/tmp/test >>> >>> %end >>> >>> >>> %post >>> >>> # Use /tmp/test to perform %post actions >>> >>> %end >>> >>> >>> >>> *Thanks,* >>> *Pushpendra Chavan.* >>> >>> >>> >>> On Tue, Jun 29, 2021 at 1:39 AM Andrew Simpson >>> wrote: >>> >>>> Is it possible to require/force a user to enter in their user account >>>> information before the install gets to the %post section via the graphical >>>> installer? I need everything else to be automated, except this step, and >>>> need to modify that user's groups in the "post" section. It appears that >>>> if nothing is entered via the GUI during install, that the install will >>>> complete without it. (root is setup as part of the ks). >>>> _______________________________________________ >>>> Kickstart-list mailing list >>>> Kickstart-list at redhat.com >>>> https://listman.redhat.com/mailman/listinfo/kickstart-list >>> >>> _______________________________________________ >>> Kickstart-list mailing list >>> Kickstart-list at redhat.com >>> https://listman.redhat.com/mailman/listinfo/kickstart-list >> >> _______________________________________________ >> Kickstart-list mailing list >> Kickstart-list at redhat.com >> https://listman.redhat.com/mailman/listinfo/kickstart-list > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simpsonar77 at gmail.com Wed Jun 30 16:33:37 2021 From: simpsonar77 at gmail.com (Andrew Simpson) Date: Wed, 30 Jun 2021 12:33:37 -0400 Subject: Require user account setup during kickstart install before %post? In-Reply-To: References: Message-ID: That's what I have seen. I was hoping that I had missed some way to make the installation stop/pause if a user hasn't entered a user/password. I have added stuff to the post to force a user to enter username/password at some point, but moving it to the PRE section is probably better. Thanks! On Wed, Jun 30, 2021 at 4:59 AM Pushpendra Chavan < chavanpushpendra at gmail.com> wrote: > I tried looking at kickstart documentation and confirmed that the user > parameter in kickstart body is actually an optional parameter which means, > if you don't provide it, kickstart body won't ask you to enter or won't > stop. > > In fact, the option to add a user isn't grayed out during kickstart in GUI > if you don't have user param in kickstart. In case someone has access to > the system physically, one can add any user and even make that user a part > of the wheel group, so many actually create a test user with --lock option > so that nobody could utilize adding a user during kickstart. > > The best way to deal with this is to create a text file in %pre and > utilize that file using the%include option in the kickstart body. > > *Thanks,* > *Pushpendra Chavan.* > > > > On Wed, Jun 30, 2021 at 8:19 AM Pushpendra Chavan < > chavanpushpendra at gmail.com> wrote: > >> Hi, >> >> You can do it as well. >> >> Just create that file in %pre section and then instead of using it in >> %post, use the following line in ks >> >> %include /path/to/file >> >> Please make sure you have the file /path/to/file written in appropriate >> Kickstart format. >> >> %pre section can be utilized to properly format it with user entered >> username and password. >> >> Regards, >> Pushpendra Chavan. >> >> >> >> On Tue, Jun 29, 2021, 7:27 PM Andrew Simpson >> wrote: >> >>> Thank you for that. I have done something similar, but all in the >>> %post. I was hoping that there was a way to force the user to use the UI >>> to enter username and password, though. >>> >>> I suppose moving this to %pre would then allow me to "set" the user >>> account in the main kickstart section using 'user ---name .....' >>> >>> >>> >>> On Tue, Jun 29, 2021 at 1:15 AM Pushpendra Chavan < >>> chavanpushpendra at gmail.com> wrote: >>> >>>> Hi, >>>> >>>> You can write a %pre script which would force ask user to enter >>>> username and password or any other information and then write that >>>> information down in a /tmp/somefile.txt >>>> Then continue the installation, and in %post section, first %post would >>>> be with --nochroot where it will copy that text file to >>>> /mnt/sysimage/somelocation >>>> And then from that location, it would utilize that information and act >>>> accordingly. >>>> >>>> You can write the %pre section as follows. I have tested this on RHEL7 >>>> >>>> %pre >>>> exec < /dev/tty7 > /dev/tty7 >>>> chvt 7 >>>> echo "Enter Manual Information in given format" >>>> read MYINFO >>>> echo $MYINFO >/tmp/test >>>> chvt 1 >>>> >>>> %end >>>> >>>> KICKSTART BODY >>>> >>>> >>>> %post --nochroot >>>> >>>> mv /tmp/test /mnt/sysimage/tmp/test >>>> >>>> %end >>>> >>>> >>>> %post >>>> >>>> # Use /tmp/test to perform %post actions >>>> >>>> %end >>>> >>>> >>>> >>>> *Thanks,* >>>> *Pushpendra Chavan.* >>>> >>>> >>>> >>>> On Tue, Jun 29, 2021 at 1:39 AM Andrew Simpson >>>> wrote: >>>> >>>>> Is it possible to require/force a user to enter in their user account >>>>> information before the install gets to the %post section via the graphical >>>>> installer? I need everything else to be automated, except this step, and >>>>> need to modify that user's groups in the "post" section. It appears that >>>>> if nothing is entered via the GUI during install, that the install will >>>>> complete without it. (root is setup as part of the ks). >>>>> _______________________________________________ >>>>> Kickstart-list mailing list >>>>> Kickstart-list at redhat.com >>>>> https://listman.redhat.com/mailman/listinfo/kickstart-list >>>> >>>> _______________________________________________ >>>> Kickstart-list mailing list >>>> Kickstart-list at redhat.com >>>> https://listman.redhat.com/mailman/listinfo/kickstart-list >>> >>> _______________________________________________ >>> Kickstart-list mailing list >>> Kickstart-list at redhat.com >>> https://listman.redhat.com/mailman/listinfo/kickstart-list >> >> _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://listman.redhat.com/mailman/listinfo/kickstart-list -------------- next part -------------- An HTML attachment was scrubbed... URL: