buildroot 增加openssh选项
(2018-02-28 16:22:49)分类: LINUX |
buildroot添加openssh选项,使用putty中的ssh登录时,总是提示,密码过期,请重新登录
from:http://lists.busybox.net/pipermail/buildroot/2011-March/042165.html
I added OpenSSH to my top level menuconfig in Buildroot. When I brought the platform up I tried to 'ssh' to the target. But each time I tried to login to the target, ssh would always force me to change my password, and then close the connection.
heyendal at ubuntu1-carlh:~$ ssh carlh at 192.168.52.190
carlh at 192.168.52.190's password: WARNING: Your password has expired. You must change your password now and login again! Changing password for carlh Old password: New password: Retype password: Password for carlh changed by carlh Connection to 192.168.52.190 closed. heyendal at ubuntu1-carlh:~$ ssh carlh at 192.168.52.190 carlh at 192.168.52.190's password: WARNING: Your password has expired. You must change your password now and login again! Changing password for carlh Old password: New password: Retype password: Password for carlh changed by carlh Connection to 192.168.52.190 closed. Despite my problem with ssh I could always login through a console without any problems. So I investigated the format of the shadow file and noticed that the 'days since last password changed' was set to '0' for my account and for root. However all the other entries in the shadow file had a substantial value for that field, and all being the same value (10933).
root:[deleted field]:0:0:99999:7:::
bin:*:10933:0:99999:7:::
daemon:*:10933:0:99999:7:::
adm:*:10933:0:99999:7:::
lp:*:10933:0:99999:7:::
sync:*:10933:0:99999:7:::
shutdown:*:10933:0:99999:7:::
halt:*:10933:0:99999:7:::
uucp:*:10933:0:99999:7:::
operator:*:10933:0:99999:7:::
nobody:*:10933:0:99999:7:::
default::10933:0:99999:7:::
carlh:[deleted field]:0:0:99999:7:::
So I changed the same field for my account and for root from 0 to 10933 and voila, it fixed the problem with ssh.
具体含义可百度linuxshadow的介绍
修改后,可以使用putty登录,secure crt选择ssh2也可以登录,但是ssh secure shell还是无法登录
查阅/var/log/message可看到问题所在
Jan 1 00:01:49 buildroot auth.info
sshd[681]: Protocol major versions differ for 192.168.1.24 port
14896: SSH-2.0-OpenSSH_7.6 vs. SSH-1.99-3.2.9 SSH Secure Shell for
Windows
Jan 1 00:06:35 buildroot auth.info
sshd[684]: Accepted password for qlc from 192.168.1.24 port 15042
ssh2
Jan 1 00:16:42 buildroot auth.info
sshd[698]: Protocol major versions differ for 192.168.1.24 port
15372: SSH-2.0-OpenSSH_7.6 vs. SSH-1.99-3.2.9 SSH Secure
Shell for Windows
SSH Secure Shell 版本和开发板中的不一样(是否可以理解为ssh1和ssh2?)
前一篇:buildroot编译文件系统
后一篇:ssh