Cool Solutions

Password Protecting ZEN Maintenance Mode



By:

April 7, 2009 3:23 pm

Reads: 3967

Comments:0

Score:0

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
    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
    
  2. tty2-6
    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.

VN:D [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: ,
Categories: Uncategorized

Disclaimer: This content is not supported by Novell. 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 it thoroughly before using it in a production environment.

Comment

RSS