Run a Script at the boot up before login
hi,
i need to write a script to boot up process before login the user.and by using that script select the run level. what i need is when linux os boot ,it should wait until user give the user name and password. according to the username and password given by user the script will be select the run level. note: user name and password should be in separate text file.and the script should run at the booting time. users credentials should be stored in script please help :) |
It doesn't work that way.
What are you actually trying to accomplish? |
Quote:
|
Quote:
What user input do you need exactly? Or are you referring to their login itself? If you need to receive user specific input before user login... you can't reasonably do that. If you need to run a script specific to one or more users, then you should put that into the user's shell init scripts, ~/.bash_profile for example. See man bash, or the man page for the intended user shell. Welcome to LQ by the way! |
Quote:
Unless you're a well-versed shell script writer I'm not expecting you to come up with the complete code but you have to try and show us. If you can't then at least start writing pseudo code until you can. If you're a budding shell script writer then start by reading. Here's some references to help get you started: BASH intros: http://www.gnu.org/software/bash/man...ode/index.html http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html http://www.tldp.org/LDP/Bash-Beginne...tml/index.html BASH scripting guides: http://mywiki.wooledge.org/BashGuide http://mywiki.wooledge.org/BashFAQ http://mywiki.wooledge.org/BashPitfalls # these are must reads so do read them! Common questions / problems: http://mywiki.wooledge.org/ParsingLs http://mywiki.wooledge.orgDontReadLinesWithFor http://mywiki.wooledge.org/UsingFind http://mywiki.wooledge.org/Arguments http://mywiki.wooledge.org/WordSplitting http://mywiki.wooledge.org/Quotes Also see: http://www.linuxquestions.org/questi...l-links-35334/ The Advanced BASH scripting guide: http://www.tldp.org/LDP/abs/html/ Bourne shell (compatibility): http://www.grymoire.com/Unix/Sh.html Quote:
|
1 Attachment(s)
Quote:
ex: user name = gayan run level = 1 1. when boot up process run it should wait for user name -> then i enter the user name--> os should run in run level 1 user name = manitha run level = 2 2. when boot up process run it should wait for user name -> then i enter the user name--> os should run in run level 2 my real requirement has been attached |
The title and contents of your initial post do not match what you want to do. Next time please be so good as to share ALL relevant information up front. The easiest way to get two-factor auth going would be to hook it into full disk encryption or look at the OpenSC project as both have layed the groundwork already and are tried and true methods.
|
Runlevels change for the entire system. i.e. all users. If you want that only one user runs is present at a time then you should use own your runscripts for the init system. Many init systems are there.
1) Runit 2) S6 3) Perp 4) Daemontools 5) Sysvinit and others. Note: Most distro are not that easy to modify. |
All times are GMT -5. The time now is 08:01 PM. |