Article

jayen's picture
article
Reads:

3774

Score:
3
3
3
 
Comments:

0

Password Protecting ZEN Maintenance Mode

(View Disclaimer)

You'll need to modify the initrd's that are loaded by maintenance mode to modify their startup scripts to prompt for a password.

  1. tty1

  2. First, we need to modify the initrd used by tty1. You can find this in your tftp server's 'boot' directory. Open it up, change the script that provides the prompt, and save the new intird.
    mkdir /tmp/initzen
    cd /tmp/initzen
    gunzip -c ~/zfd/tftp/boot/initrd | cpio -idv
    
    

    add to bin/prompt.s:

     trap '' SIGINT
     while true; do
       read -p 'password: ' -s;
       echo;
       if [ $REPLY == password ]; then
         break;
       fi;
     done
     trap - SIGINT 
    
    
    find | cpio -H newc -o | gzip > ~/zfd/tftp/boot/initrd
    

  3. tty2-6

  4. Second, we need to modify the initrd used by the other ttys. You can find this in your tftp server's 'boot' directory (this one s called 'root'). Open it up, change the system bash profile, and save the new intird.

    mkdir /tmp/initzen2
    gunzip -c ~/zfd/tftp/boot/root > /tmp/root.ext2
    sudo mount /tmp/root.ext2 /tmp/initzen2/ -o loop
    cd /tmp/initzen2
    
    

    add to etc/profile:

     trap '' SIGINT
     while true; do
       read -p 'password: ' -s;
       echo;
       if [ $REPLY == password ]; then
         break;
       fi;
     done
     trap - SIGINT 
    
    
    gzip < /tmp/root.ext2 > ~/zfd/tftp/boot/root
    

Tada! All safe now.


Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

© 2013 Novell