The default password for imx28 for root user I guess is blank right.?
But, if you want a different password in your rootfs by default, you can decompress the rootfs, create a password using "mkpasswd" utility and edit the entry in the /etc/shadow file for the root user,
You can automate the process with the following script (save it in a file and execute):
#!/bin/bash
# Script to Create initial password in rootfs for the arm system
#
# Date Written : April 3rd, 2013
# Author : Binoy Jayan [binoyjayan@gmail.com]
MKPASSWD=$(type -path mkpasswd)
if [ -z "${MKPASSWD}" ]; then
# Doesn't exist
echo 'Command "mkpasswd" not found. Please install it using'
echo 'sudo apt-get install mkpasswd'
exit;
fi
if [ "$1" == "" -o "$2" == "" -o "$3" == "" ]
then
echo ""
echo "Script to Create initial password in rootfs"
echo "A hashed password is created in the /etc/shadow file of the rootfs"
echo ""
echo "Usage:"
echo ""
echo "mkpasswd.sh <shadow_file> <username> <password>"
echo ""
echo "shadow_file : Path to the shadow file in rootfs folder. i.e. rootfs/etc/shadow"
echo "username : The user account you need to change the password of"
echo " If the user mentioned does not exist in shadow file, no change is made"
echo "password : The new password to be set for the user"
echo ""
echo "Example:"
echo ""
echo "mkpasswd.sh rootfs/etc/shadow root root123"
echo ""
echo "Important:"
echo "Never provide the shadow file path '/etc/shadow' of the system you are running on:"
echo "It may prevent your user account to be locked out permanently"
echo "So, never use this script to change the password of your own system"
echo "Note that rootfs folder, username and password must not have spaces"
echo ""
exit
fi
if [ ! -f "$1" ]
then
echo "Cannot find the shadow file '$1' in the rootfs"
echo "Please mention correct rootfs path as the first argument (with no spaces)"
exit
fi
SHADOW=$1
USER=$2
PASS=$3
BACKUP=/tmp/_shadow.backup
HASH=`mkpasswd --method=md5 ${PASS}`
echo "Generated md5 password Hash for ${USER} :${HASH}"
echo ""
echo "Backing up old shadow file in ${BACKUP}"
cp ${SHADOW} ${BACKUP}
echo ""
echo "Writing new password hash in shadow file '${SHADOW}'..."
sed "s_\(${USER}\):\([^:]*\)_\1:${HASH}_" ${BACKUP} > ${SHADOW}
echo "done"
The default password for imx28 for root user I guess is blank right.?
But, if you want a different password in your rootfs by default, you can decompress the rootfs, create a password using "mkpasswd" utility and edit the entry in the /etc/shadow file for the root user,
You can automate the process with the following script (save it in a file and execute):
#!/bin/bash
# Script to Create initial password in rootfs for the arm system
#
# Date Written : April 3rd, 2013
# Author : Binoy Jayan [binoyjayan@gmail.com]
MKPASSWD=$(type -path mkpasswd)
if [ -z "${MKPASSWD}" ]; then
# Doesn't exist
echo 'Command "mkpasswd" not found. Please install it using'
echo 'sudo apt-get install mkpasswd'
exit;
fi
if [ "$1" == "" -o "$2" == "" -o "$3" == "" ]
then
echo ""
echo "Script to Create initial password in rootfs"
echo "A hashed password is created in the /etc/shadow file of the rootfs"
echo ""
echo "Usage:"
echo ""
echo "mkpasswd.sh <shadow_file> <username> <password>"
echo ""
echo "shadow_file : Path to the shadow file in rootfs folder. i.e. rootfs/etc/shadow"
echo "username : The user account you need to change the password of"
echo " If the user mentioned does not exist in shadow file, no change is made"
echo "password : The new password to be set for the user"
echo ""
echo "Example:"
echo ""
echo "mkpasswd.sh rootfs/etc/shadow root root123"
echo ""
echo "Important:"
echo "Never provide the shadow file path '/etc/shadow' of the system you are running on:"
echo "It may prevent your user account to be locked out permanently"
echo "So, never use this script to change the password of your own system"
echo "Note that rootfs folder, username and password must not have spaces"
echo ""
exit
fi
if [ ! -f "$1" ]
then
echo "Cannot find the shadow file '$1' in the rootfs"
echo "Please mention correct rootfs path as the first argument (with no spaces)"
exit
fi
SHADOW=$1
USER=$2
PASS=$3
BACKUP=/tmp/_shadow.backup
HASH=`mkpasswd --method=md5 ${PASS}`
echo "Generated md5 password Hash for ${USER} :${HASH}"
echo ""
echo "Backing up old shadow file in ${BACKUP}"
cp ${SHADOW} ${BACKUP}
echo ""
echo "Writing new password hash in shadow file '${SHADOW}'..."
sed "s_\(${USER}\):\([^:]*\)_\1:${HASH}_" ${BACKUP} > ${SHADOW}
echo "done"