Reset password through web console

I have a web console in AIX, but | (pipe stream), » and > do not work. How can I reset my password for account xx.

method 1

1
2
3
4
5
6
7
mkdir /home/xx/.ssh
ssh-keygen -t rsa -P password -f /home/xx/.ssh/id_rsa (ssh-keygen -t rsa -P '' -f /home/xx/.ssh/id_rsa not work since no passphase)
cp id_rsa.pub authorized_keys
chmod 600 /home/xx/.ssh/authorized_keys
chown -R xx:sms /home/xx/.ssh
chmod 700 /home/xx/.ssh
cat /home/xx/.ssh/id_rsa(then copy and paste in web console, save as id_rsa, then save as private key in putty)

method 2

1
2
3
4
5
6
rpm or download **wget** prepare id_rsa, id_rsa.pub, authorized_keys
/home/xx/soft/usr/local/bin/wget -O /home/xx/.ssh/id_rsa http://10.13.135.40:8080/dh/keygen/id_rsa
/home/xx/soft/usr/local/bin/wget -O /home/xx/.ssh/id_rsa.pub http://10.13.135.40:8080/dh/keygen/id_rsa.pub
/home/xx/soft/usr/local/bin/wget -O /home/xx/.ssh/authorized_keys http://10.13.135.40:8080/dh/keygen/authorized_keys
chown -R xx:sms /home/xx/.ssh
chmod 700 /home/xx/.ssh

method 3 (fail in AIX)

1
2
echo "xx1234\nxx1234" | (passwd -stdin xx)
echo -e "xx1234\nxx1234" | (passwd -stdin xx) – in Linux

method 4 (fail in AIX)

echo "xx:xx1234" | chpasswd -c

method 5

download expect package from http://www.oss4aix.org/download/RPMS/

1
2
3
4
5
6
7
8
9
rpm -ivh libpng-1.6.7-1.aix5.1.ppc.rpm
rpm -ivh zlib-1.2.8-1.aix5.1.ppc.rpm
rpm -ivh bzip2-1.0.6-1.aix5.1.ppc.rpm
rpm -ivh freetype2-2.5.2-1.aix5.1.ppc.rpm
rpm -ivh expat-2.1.0-1.aix5.1.ppc.rpm
rpm -ivh fontconfig-2.10.2-1.aix5.1.ppc.rpm
rpm -ivh tk-8.5.15-1.aix5.1.ppc.rpm
rpm -ivh tcl-8.5.15-1.aix5.1.ppc.rpm
rpm -ivh expect-5.45-1.aix5.1.ppc.rpm

write expect script /home/xx/chpass.sh

1
2
3
4
5
6
#!/usr/bin/expect
spawn passwd support
expect "*password*"
send "xx1234\n"
expect "*password*"
send "xx1234\n" exit

Others

I try different account to login system, grant sudo right to this account, change the password using pwdadm and passwd, but when I login with putty, found that Access denied. When I run su - user, found “3004-303 There have been too many unsuccessful login attempts; please see the system administrator”, found the root cause, after google, easy two steps can sovle it.

1
2
- /usr/sbin/lsuser -a unsuccessful_login_count user
- /usr/bin/chsec -f /etc/security/lastlog -a unsuccessful_login_count=0 -s user

http://aix4admins.blogspot.hk/2012/06/user-login-process-login-process.html
http://hi.baidu.com/unixsec/item/fa155d8e16cb0cdf5e0ec157"
pwdadm 命令

Ref

expect
expect-lite