Re: [lfs-support] Unable to login SOLVED
Op Fri, 04 Oct 2013 23:13:20 +0200 schreef Bruce Dubbs bruce.du...@gmail.com: Then: strace -olog.txt login I looked at a trace for my system. Do you have /etc/group? These are my opens, disregarding library and files not found: open(/etc/login.defs, O_RDONLY) = 3 open(/root/.bash_history, O_RDONLY) = 3 The last part of the list of files were not opened because login did not come that far. Check that login.defs, nsswitch.conf, passwd, login.access, and group all exist. Note that shadow is not opened. Because you use no password? All the files are there. I copied passwd, groups and shadow from my succesful build of LFS7_3 to LFS7_4, but no log-in, although a different error-message. Then, in the end, I re-installed Shadow et voila: a successful login! Analysing the logs, I saw no differences with the first install, apart from installs by libtool from /usr/bin/install instead of /tools/bin/install, but that shall originate from the fact that in the first build libtool was build after Shadow. That leaves the question why the failures occurred in the first place? Any suggestion were I should look in the strace-logfiles to get a clue? LFS is for learning, he? The login-failure occurred after the password was given. In the successful login login.access was opened, but that was not the case in the failed login, although /etc/login.access existed. There was also no failure of opening that file. But again, Bruce, I am, very grateful for your extensive help!! Hans. -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login SOLVED
hans kaper wrote: Op Fri, 04 Oct 2013 23:13:20 +0200 schreef Bruce Dubbs bruce.du...@gmail.com: Then: strace -olog.txt login I looked at a trace for my system. Do you have /etc/group? These are my opens, disregarding library and files not found: open(/etc/login.defs, O_RDONLY) = 3 open(/root/.bash_history, O_RDONLY) = 3 The last part of the list of files were not opened because login did not come that far. Check that login.defs, nsswitch.conf, passwd, login.access, and group all exist. Note that shadow is not opened. Because you use no password? Not normally. I just did it to check things for you. All the files are there. I copied passwd, groups and shadow from my succesful build of LFS7_3 to LFS7_4, Yes, I do that all the time. Also gshadow, bashrc, profile{,.d}, vimrc, dircolors, inputrc, and a few others. But that's off topic. but no log-in, although a different error-message. Then, in the end, I re-installed Shadow et voila: a successful login! There you go. Analysing the logs, I saw no differences with the first install, apart from installs by libtool from /usr/bin/install instead of /tools/bin/install, but that shall originate from the fact that in the first build libtool was build after Shadow. Yes, that's reasonable. That leaves the question why the failures occurred in the first place? Any suggestion were I should look in the strace-logfiles to get a clue? LFS is for learning, he? Yes. The login-failure occurred after the password was given. In the successful login login.access was opened, but that was not the case in the failed login, although /etc/login.access existed. There was also no failure of opening that file. My only guess would be that something was either not installed or installed in the wrong place the first time around. In the end, the only way to really analyze what was going on is to look at the source code. Obviously the login program was executing. Follow the source after you typed the username and see if you can correlate that to the strace logs. That's about the only suggestion I can offer at this point. Look at src/login_nopam.c and src/login.c But again, Bruce, I am, very grateful for your extensive help!! No problem. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login
Op Thu, 03 Oct 2013 23:04:51 +0200 schreef William Harrington kb0...@berzerkula.org: On Oct 3, 2013, at 3:24 PM, hans kaper wrote: I added a line and an error occurred. So login.defs was read. Now find the line that is causing the invalid argument chroot and run login and see what happens. The same error!! Also, install strace and run login and see what happens. Installing strace gives a make-error: gcc -DHAVE_CONFIG_H -I. -I./linux/i386 -I./linux -I./linux -Wall -Wwrite-strings -g -O2 -MT process.o -MD -MP -MF .deps/process.Tpo -c -o process.o process.c In file included from process.c:66:0: /usr/include/linux/ptrace.h:58:8: error: redefinition of 'struct ptrace_peeksiginfo_args' struct ptrace_peeksiginfo_args { ^ In file included from defs.h:159:0, from process.c:37: /usr/include/sys/ptrace.h:191:8: note: originally defined here struct ptrace_peeksiginfo_args ^ make[2]: *** [process.o] Error 1 make[2]: Leaving directory `/sources/strace-4.8' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/sources/strace-4.8' make: *** [all] Error 2 I tried to verify the packet with gpg: error: public key not found. How to find that key? I am not that experienced with gpg. By the way, thanks to Bruce and you for the effort to help me. Hans. -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login
hans kaper wrote: Op Thu, 03 Oct 2013 23:04:51 +0200 schreef William Harrington kb0...@berzerkula.org: On Oct 3, 2013, at 3:24 PM, hans kaper wrote: I added a line and an error occurred. So login.defs was read. Now find the line that is causing the invalid argument chroot and run login and see what happens. The same error!! Also, install strace and run login and see what happens. Installing strace gives a make-error: gcc -DHAVE_CONFIG_H -I. -I./linux/i386 -I./linux -I./linux -Wall -Wwrite-strings -g -O2 -MT process.o -MD -MP -MF .deps/process.Tpo -c -o process.o process.c In file included from process.c:66:0: /usr/include/linux/ptrace.h:58:8: error: redefinition of 'struct ptrace_peeksiginfo_args' struct ptrace_peeksiginfo_args { ^ In file included from defs.h:159:0, from process.c:37: /usr/include/sys/ptrace.h:191:8: note: originally defined here struct ptrace_peeksiginfo_args Use the patch: http://www.linuxfromscratch.org/patches/downloads/strace/strace-4.8-glibc_2.18_build_fix-1.patch -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login
Op Fri, 04 Oct 2013 17:13:50 +0200 schreef Bruce Dubbs bruce.du...@gmail.com: hans kaper wrote: Op Thu, 03 Oct 2013 23:04:51 +0200 schreef William Harrington kb0...@berzerkula.org: On Oct 3, 2013, at 3:24 PM, hans kaper wrote: Also, install strace and run login and see what happens. Use the patch: http://www.linuxfromscratch.org/patches/downloads/strace/strace-4.8-glibc_2.18_build_fix-1.patch That worked! First line in Password is now: root::0:0:root:/root:/bin/bash I omitted the x after the first :, as Bruce advised. I assume that then no password is necessary. Next I chroot as in the begin of ch.6, so that devices are loaded. Then: strace -olog.txt login The log-file gives a lot of data, but I think the most important are: . read(0, root\n, 1024) (reading from the kbd) . open(/etc/passwd, O_RDONLY|O_CLOEXEC) = 3 .. read(3, root::0:0:root:/root:/bin/bash\nb..., 4096) = 159 ... write(4, Wachtwoord: , 12)= 12 (=Password: ) read(4, \n, 4096) = 1 (just Enter, no password necessary) write(4, \n, 1) ... _llseek(4, 0, 0xbfeae3e0, SEEK_CUR) = -1 ESPIPE (Illegal seek) I assume the last line is the error, but I don't know what it means. If I give the password, the result is the same. Hans. -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login
hans kaper wrote: Op Fri, 04 Oct 2013 17:13:50 +0200 schreef Bruce Dubbs bruce.du...@gmail.com: hans kaper wrote: Op Thu, 03 Oct 2013 23:04:51 +0200 schreef William Harrington kb0...@berzerkula.org: On Oct 3, 2013, at 3:24 PM, hans kaper wrote: Also, install strace and run login and see what happens. Use the patch: http://www.linuxfromscratch.org/patches/downloads/strace/strace-4.8-glibc_2.18_build_fix-1.patch That worked! First line in Password is now: root::0:0:root:/root:/bin/bash I omitted the x after the first :, as Bruce advised. I assume that then no password is necessary. That's right. Next I chroot as in the begin of ch.6, so that devices are loaded. Then: strace -olog.txt login The log-file gives a lot of data, but I think the most important are: . read(0, root\n, 1024) (reading from the kbd) . open(/etc/passwd, O_RDONLY|O_CLOEXEC) = 3 .. read(3, root::0:0:root:/root:/bin/bash\nb..., 4096) = 159 ... write(4, Wachtwoord: , 12)= 12 (=Password: ) This shouldn't happen. The sequence is: root:~$ login blfs login: root No mail. -bash-4.2# If there is no pw, then it shouldn't even ask for one. read(4, \n, 4096) = 1 (just Enter, no password necessary) write(4, \n, 1) ... _llseek(4, 0, 0xbfeae3e0, SEEK_CUR) = -1 ESPIPE (Illegal seek) I assume the last line is the error, but I don't know what it means. If I give the password, the result is the same. I looked at a trace for my system. Do you have /etc/group? These are my opens, disregarding library and files not found: open(/etc/login.defs, O_RDONLY) = 3 open(/etc/nsswitch.conf, O_RDONLY|O_CLOEXEC) = 3 open(/etc/passwd, O_RDONLY|O_CLOEXEC) = 3 open(/etc/passwd, O_RDONLY|O_CLOEXEC) = 3 open(/etc/login.access, O_RDONLY) = 3 open(/var/log/lastlog, O_RDWR)= 3 open(/etc/group, O_RDONLY|O_CLOEXEC) = 3 open(/var/log/wtmp, O_WRONLY) = 3 open(/proc/sys/kernel/ngroups_max, O_RDONLY) = 3 open(/etc/group, O_RDONLY|O_CLOEXEC) = 3 open(/etc/passwd, O_RDONLY|O_CLOEXEC) = 3 open(/etc/localtime, O_RDONLY|O_CLOEXEC) = 3 open(/dev/tty, O_RDWR|O_NONBLOCK) = 3 open(/proc/meminfo, O_RDONLY|O_CLOEXEC) = 3 open(/etc/nsswitch.conf, O_RDONLY|O_CLOEXEC) = 3 open(/lib/libnss_files.so.2, O_RDONLY|O_CLOEXEC) = 3 open(/etc/passwd, O_RDONLY|O_CLOEXEC) = 3 open(/etc/profile, O_RDONLY) = 3 open(/root/.bash_history, O_RDONLY) = 3 open(/root/.bash_history, O_RDONLY) = 3 open(/usr/share/terminfo/x/xterm, O_RDONLY) = 3 open(/etc/inputrc, O_RDONLY) = 3 open(/root/.bash_history, O_WRONLY|O_APPEND) = 3 open(/root/.bash_history, O_RDONLY) = 3 Check that login.defs, nsswitch.conf, passwd, login.access, and group all exist. Note that shadow is not opened. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
[lfs-support] Unable to login
I build LFS 7.4 from the book. It boots all-right but I cannot login: login: root password: xx crypt: Invalid argument Trying another user fails too. I double checked inittab and the shadow-build, but found no faults. The same goes for the kernel-config file. What can be the reason of the failing login? Hans. -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login
hans kaper wrote: I build LFS 7.4 from the book. It boots all-right but I cannot login: login: root password: xx crypt: Invalid argument Trying another user fails too. I double checked inittab and the shadow-build, but found no faults. The same goes for the kernel-config file. What can be the reason of the failing login? Did you set the password for root? -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login
Op Thu, 03 Oct 2013 22:05:25 +0200 schreef Bruce Dubbs bruce.du...@gmail.com: hans kaper wrote: I build LFS 7.4 from the book. It boots all-right but I cannot login: login: root password: xx crypt: Invalid argument Trying another user fails too. I double checked inittab and the shadow-build, but found no faults. The same goes for the kernel-config file. What can be the reason of the failing login? Did you set the password for root? -- Bruce Of course. -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login
On Oct 3, 2013, at 3:01 PM, hans kaper wrote: login: root password: xx crypt: Invalid argument Not using pam? Also, double check your login.defs in /etc Sincerely, WIlliam Harrington -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login
hans kaper wrote: Op Thu, 03 Oct 2013 22:05:25 +0200 schreef Bruce Dubbs bruce.du...@gmail.com: hans kaper wrote: I build LFS 7.4 from the book. It boots all-right but I cannot login: login: root password: xx crypt: Invalid argument Trying another user fails too. I double checked inittab and the shadow-build, but found no faults. The same goes for the kernel-config file. What can be the reason of the failing login? Did you set the password for root? Of course. Then you probably have the wrong password or didn't install shadow properly. To get in, you can edit /etc/passwd so root's entry is: root::0:0:root:/root:/bin/bash Notice that the 2nd entry is null. That should get you in without a password. Then run passwd again and set your pw to whatever you want. Also, When setting the password in chroot, the /dev and /dev/pts virtual file systems must be available. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login
Op Thu, 03 Oct 2013 22:13:02 +0200 schreef William Harrington kb0...@berzerkula.org: On Oct 3, 2013, at 3:01 PM, hans kaper wrote: login: root password: xx crypt: Invalid argument Not using pam? LFS book 7.4, page 124:... They also require Linux-PAM which is not available in LFS. Also, double check your login.defs in /etc I added a line and an error occurred. So login.defs was read. -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login
Op Thu, 03 Oct 2013 22:20:51 +0200 schreef Bruce Dubbs bruce.du...@gmail.com: hans kaper wrote: Op Thu, 03 Oct 2013 22:05:25 +0200 schreef Bruce Dubbs bruce.du...@gmail.com: hans kaper wrote: I build LFS 7.4 from the book. It boots all-right but I cannot login: login: root password: xx crypt: Invalid argument Trying another user fails too. I double checked inittab and the shadow-build, but found no faults. The same goes for the kernel-config file. What can be the reason of the failing login? Did you set the password for root? Of course. Then you probably have the wrong password or didn't install shadow properly. I checked the shadow-build , but did not find any errors. To get in, you can edit /etc/passwd so root's entry is: root::0:0:root:/root:/bin/bash That did not work either; same error. I don't expect a keyboard-problem: all the letters appear as typed. Hans. -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: [lfs-support] Unable to login
On Oct 3, 2013, at 3:24 PM, hans kaper wrote: I added a line and an error occurred. So login.defs was read. Now find the line that is causing the invalid argument chroot and run login and see what happens. Also, install strace and run login and see what happens. Sincerely, William Harrington -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page