Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

university:tools:m2k:common:customizing [20 Jan 2020 14:09]
Cristina Suteu created
university:tools:m2k:common:customizing [22 Jun 2020 11:07]
Michael Hennerich new commands
Line 70: Line 70:
  
 Setting this to ''​1''​ will calibrate the board. Setting this to ''​1''​ will calibrate the board.
 +
 +===== Changing the root password on the target =====
 +
 +In M2k firmware version v0.26 and later there are two new command/​scripts,​
 +facilitating persistent SSH key and password changes.
 +
 +
 +Use the ''​device_passwd''​ command to permanently change the password.
 +This script/​command calls the Linux passwd command and stores all user/​password related files on mtd2 (JFFS2).
 +The next time the system boots it will check all the MD5 sums and then uses this password instead.
 +
 +<WRAP box bggreen><​wrap info>​This specifies any shell prompt running on the target. The ''#''​ is the prompt, and the **''​bold''​** is what you type</​wrap>​
 +<​xterm>​
 +# **device_passwd** ​
 +Changing password for root
 +New password: ​
 +Bad password: too short
 +Retype password: ​
 +passwd: password for root changed by root
 +#
 +</​xterm>​
 +</​WRAP>​
 +
 +**Note:** In case you forgot your password, there a mechanism which allows you to revert to the default password using the config.txt file on the mass storage device.
 +Add ''​revert_passwd = 1''​ under the ''​[ACTIONS]''​ sections, then follow the procedure described here: [[.:​customizing#​config_file_actions | Config File ACTIONS]]
 +
 +===== Enabling persistent SSH keys =====
 +
 +In M2k firmware version v0.26 and later there are two new command/​scripts,​
 +facilitating persistent SSH key and password changes.
 +
 +Use the ''​device_persistent_keys''​ command to permanently store your private SSH dropbear keys.
 +This script/​command copies the current key or generates one, which is now stored on mtd2 (JFFS2).
 +The next time the system boots it will check the MD5 sum and then uses this key instead.
 +
 +<WRAP box bggreen><​wrap info>​This specifies any shell prompt running on the target. The ''#''​ is the prompt, and the **''​bold''​** is what you type</​wrap>​
 +<​xterm>​
 +# **device_persistent_keys** ​
 +Generating 256 bit ecdsa key, this may take a while...
 +Public key portion is:
 +ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBH+cMtkirbmWjOq+EjW0Lzir5LVuWXFwRTOMOnb0eWo
 +Fingerprint:​ sha1!! 10:​9c:​40:​18:​f8:​e3:​10:​f1:​c8:​62:​ba:​8d:​27:​48:​1b:​35:​16:​8d:​a5:​f5
 +#
 +</​xterm>​
 +</​WRAP>​
university/tools/m2k/common/customizing.txt · Last modified: 22 Jun 2020 11:07 by Michael Hennerich