magicpio
Group: Members
Posts: 20
Joined: Sep. 2004 |
|
Posted: July 04 2005,20:37 |
|
Q: How do I save passwords between reboots?
A: Valid for DSL 1.2.1, frugal install
If you have a persistent /opt directory:
1) Open an Xterminal. 2) Switch to root access: sudo su 3) Create an additional directory /pwd in your /opt folder: mkdir /opt/pwd 4) Copy all password files into this directory: cd /opt/pwd cp -f /etc/passwd passwd cp -f /etc/passwd- passwd- cp -f /etc/group group cp -f /etc/group- group- cp -f /etc/shadow shadow cp -f /etc/shadow- shadow- cp -f /etc/gshadow gshadow cp -f /etc/gshadow- gshadow- 5) Open the file /home/dsl/bootlocal.sh with any editor and add the following lines: /etc/init.d/ssh_addusers cp -f /opt/pwd/passwd /etc/passwd cp -f /opt/pwd/passwd- /etc/passwd- cp -f /opt/pwd/group /etc/group cp -f /opt/pwd/group- /etc/group- cp -f /opt/pwd/shadow /etc/shadow cp -f /opt/pwd/shadow- /etc/shadow- cp -f /opt/pwd/gshadow /etc/gshadow cp -f /opt/pwd/gshadow- /etc/gshadow-
Now you should be ready to use SSH for example.
Remark 1: Other, older and newer releases, might use a different set of files. Look into /etc/init.d/ssh_addusers for at least some of those files.
Remark 2: It is not possible to just add the password files to filetool.lst, because when DSL does the restore operation, the destination files in /etc might still be write protected. To make them (over-)writable, the command ssh_addusers has to be executed in advance. To execute a command, it should be placed in bootlocal.sh , which is restored as well, but the script itself is only executed after the restore (when the copy operation for the password files failed already).
Pio
|