LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Adding a shell script in start up of single user mode.. (https://www.linuxquestions.org/questions/linux-newbie-8/adding-a-shell-script-in-start-up-of-single-user-mode-930448/)

logan_the_wolverine 02-21-2012 03:10 AM

Adding a shell script in start up of single user mode..
 
please help me out ...
I want to add a shell script of passwd prompt in the single user mode runlevel at the start up.
i am working on red hat v5.
i have already made my shell scripts

:newbie:

acid_kewpie 02-21-2012 03:17 AM

I'd expect that this is not a good solution to your problem, can you explain more about what you want here? If you're doing this from a security perspective, I would suggest using a boot loader password to prevent unauthorized boot configs, e.g. going into init 1 in the first place. Messing with the runlevel setup itself is very likely to bring up other issues.

logan_the_wolverine 02-22-2012 08:55 AM

yes you are right my friend...acid_kewpie
that going in runlevel and init file is massive work. and also boot loader configuration is best way in the security perspective.

but i only have to add a shell script in the startup of single user mode. shell script is for printing a massage on system screen using echo command. please tell me formal step for adding a shell script in the startup of single user mode.

TB0ne 02-22-2012 09:36 AM

Quote:

Originally Posted by logan_the_wolverine (Post 4609209)
yes you are right my friend...acid_kewpie
that going in runlevel and init file is massive work. and also boot loader configuration is best way in the security perspective.

but i only have to add a shell script in the startup of single user mode. shell script is for printing a massage on system screen using echo command. please tell me formal step for adding a shell script in the startup of single user mode.

Ahh...so a homework question, then?? Consider looking in the /etc/init.d/rc1.d directory, and putting a link to your shell-script in that.

anomie 02-22-2012 10:21 AM

@logan:

"Adding a shell script" is not the right answer to this problem. init(8) already has a means for solving this.

Read the inittab(5) manpages.

For further clarification, read (under the heading -- Enable Authentication for Single-User Mode):
http://www.cyberciti.biz/tips/tips-t...le-access.html

Point is, don't reinvent the wheel. It is as simple as:
Code:

~:S:wait:/sbin/sulogin


All times are GMT -5. The time now is 11:43 AM.