-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
board: pluto & m2k: Enable persistent ssh keys and passwd changes
This patch adds support for saving the SSH keys and password files on the JFFS2 partition on mtd2. There are three new helper scripts for this. Signed-off-by: Michael Hennerich <[email protected]>
- Loading branch information
1 parent
1bfa9dc
commit 2ee30e3
Showing
7 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
set +e | ||
|
||
while true; | ||
do | ||
read -p "Are you sure to delete/format your mtd2 JFFS2 partition? (yes/no) " answ | ||
case $answ in | ||
[Yy]* ) flash_erase -j /dev/mtd2 0 0; break;; | ||
[Nn]* ) exit;; | ||
* ) echo "Please answer yes or no.";; | ||
esac | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
set +e | ||
|
||
cat /proc/mounts | grep -q mtd2 || (echo "Filesystem not mounted use device_format_jffs2 command to setup your partition"; exit 1) | ||
|
||
passwd | ||
install -D /etc/passwd /etc/shadow /etc/group -t /mnt/jffs2/etc | ||
cd /etc | ||
md5sum passwd shadow group 2>/dev/null > /mnt/jffs2/etc/password.md5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
set +e | ||
|
||
KEYFILE=/etc/dropbear/dropbear_ecdsa_host_key | ||
|
||
cat /proc/mounts | grep -q mtd2 || (echo "Filesystem not mounted use device_format_jffs2 command to setup your partition"; exit 1) | ||
|
||
#dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key | ||
[[ ! -f ${KEYFILE} ]] && dropbearkey -t ecdsa -f ${KEYFILE} | ||
install -D ${KEYFILE} -t /mnt/jffs2/etc/dropbear | ||
cd /etc/dropbear | ||
md5sum dropbear* /etc/dropbear/ 2>/dev/null > /mnt/jffs2/etc/dropbear/keys.md5 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters