LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 750|回复: 6

Login problem

[复制链接]
发表于 2005-8-24 12:52:41 | 显示全部楼层 |阅读模式
Hi folks,

BLFS 6.1
FC3 Host

On chroot environment after having installed
CrackLib-2.8.3
http://www.linuxfromscratch.org/ ... stlfs/cracklib.html
Linux-PAM-0.80
http://www.linuxfromscratch.org/ ... tlfs/linux_pam.html

reinstalled Shadow-4.0.9 according to the book;
http://www.linuxfromscratch.org/ ... postlfs/shadow.html

I was held on 'login' (with CrackLib), saying "bash: /etc/pam.d/login: No such file or directory"

According to the "Warning" near the bottom on the same page, reinstalled Shadow-4.0.9 with "--without-libpam" and also moved the /etc/login.defs.orig backup file to /etc/login.defs

Now I can't login LFS 6.1 with following warning;
LoginAM Failure, aborting: Critical error - immediate abort

I did it twice including removing the source tree of Shadow-4.0.9 and download new packages from Internet as well

What I discovered are follows;

[root@localhost satimis]# find /mnt/lfs/ -name login.defs

  1. /mnt/lfs/sources/shadow-4.0.9/etc/login.defs
  2. /mnt/lfs/etc/login.defs
复制代码


[root@localhost satimis]# find /mnt/lfs/ -name security -type d

  1. ....
  2. /mnt/lfs/etc/security
  3. /mnt/lfs/lib/security
  4. /mnt/lfs/usr/include/security
  5. /mnt/lfs/usr/lib/firefox-1.0.6/chrome/en-US/locale/global/security
  6. /mnt/lfs/usr/src/linux-2.6.11.12/security
  7. ....
复制代码


[root@localhost satimis]# ls -al /mnt/lfs/etc/ | grep pam.d
[root@localhost satimis]# ls -al /mnt/lfs/etc/ | grep pam.conf
Both no printout

[root@localhost satimis]# find /mnt/lfs/ -name pam.d -type d

  1. /mnt/lfs/sources/shadow-4.0.9/etc/pam.d
  2. ......
复制代码


[root@localhost satimis]# ls -al /mnt/lfs/sources/shadow-4.0.9/etc/pam.d/
  1. total 128
  2. drwxrwxrwx  2 satimis satimis 4096 May 23 19:33 .
  3. drwxrwxrwx  3 satimis satimis 4096 May 23 19:33 ..
  4. -rw-rw-r--  1 satimis satimis  130 Oct 24  2004 chage
  5. -rw-rw-r--  1 satimis satimis  133 Oct 24  2004 chpasswd
  6. -rw-rw-r--  1 satimis satimis  133 Oct 24  2004 groupadd
  7. -rw-rw-r--  1 satimis satimis  133 Oct 24  2004 groupdel
  8. -rw-rw-r--  1 satimis satimis  133 Oct 24  2004 groupmod
  9. -rw-rw-r--  1 satimis satimis  993 Oct 24  2004 login
  10. -rw-rw-r--  1 satimis satimis  264 Oct 26  2004 Makefile.am
  11. -rw-rw-r--  1 satimis satimis 9488 May  5 01:00 Makefile.in
  12. -rw-rw-r--  1 satimis satimis  133 Oct 24  2004 newusers
  13. -rw-rw-r--  1 satimis satimis  117 Oct 10  2000 passwd
  14. -rw-rw-r--  1 satimis satimis  213 Jan  2  2005 su
  15. -rw-rw-r--  1 satimis satimis  122 Oct 28  2004 useradd
  16. -rw-rw-r--  1 satimis satimis  132 Oct 24  2004 usermod
复制代码


[root@localhost satimis]# find /mnt/lfs/ -name pam.conf

  1. /mnt/lfs/sources/Linux-PAM-0.80/conf/pam.conf
  2. /mnt/lfs/.Trash-0/files/Linux-PAM-0.80/conf/pam.conf
复制代码


[root@localhost satimis]# ls -al /mnt/lfs/sources/Linux-PAM-0.80/conf/pam.conf

  1. -rw-r--r--  1 358 ftp 4415 Apr  8  2001 /mnt/lfs/sources/Linux-PAM-0.80/conf/pam.conf
复制代码


Both of them were not on;
/etc/pam.d/
/etc/pam.conf

Please advise how to fix the login problme.  Whether moving pam.d and pam.conf to their correct directories.

B.R.
satimis
发表于 2005-8-24 15:53:13 | 显示全部楼层
http://www.linuxfromscratch.org/ ... tlfs/linux_pam.html 中,最下边的信息,你都没输入。

Configuration Information


shadow里边也有类似的信息。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-24 16:28:12 | 显示全部楼层
Hi 黯然销魂,

最下边的信息,你都没输入

Configuration Information
Oh, yes.  You meant follows;
  1. # Begin /etc/pam.d/other
  2. auth            required        pam_unix.so     nullok
  3. account         required        pam_unix.so
  4. session         required        pam_unix.so
  5. password        required        pam_unix.so     nullok

  6. # End /etc/pam.d/other
  7. --------------------------------------
  8. # Begin /etc/pam.conf

  9. other           auth            required        pam_unix.so     nullok
  10. other           account         required        pam_unix.so
  11. other           session         required        pam_unix.so
  12. other           password        required        pam_unix.so     nullok

  13. # End /etc/pam.conf
复制代码
What shall I replace "other" here.
  1. # cat /etc/pam.d/other << "EOF"
复制代码
Please advise.

shadow里边也有类似的信息。
I haven''t coompleted the whole page of " shadow-4.0.9" because I was held on

'login' (with CrackLib)
......
bash: /etc/pam.d/login: No such file or directory

Maybe after completing the above Configuration Information, then I can go through.

satimis
回复 支持 反对

使用道具 举报

发表于 2005-8-24 18:03:45 | 显示全部楼层
PAM和shadow最好一起做。不然就是给自己增加麻烦:)。

如果没logout的话,先直接装shadow,然后就把shadow里边的那些配置写上就可以了。

如果已经logout了,那就按照pam里边的写。

other不需要替换,就是other。2个选一个写就可以了。

-------
我没把这两个分开弄过,所以不知道分开编译会有什么后果。。。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-24 19:07:04 | 显示全部楼层
Hi 黯然销魂,

Tks for your advice.

My problem was I could not discover when the directory /etc/pam.d has been created.  

Ran
# cat /etc/pam.d/other << "EOF"
won't create the directory automatically.  Whether it must be created first
# mkdir /etc/pam.d
before running
# cat /etc/pam.d/other << "EOF"
to create the file "other".  Otherwise it would complain "Directory or file not found"

satimis
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-24 23:43:56 | 显示全部楼层
Hi folks,

Login revived after running;
# install -v -m755 -d /etc/pam.d

and compketing Section Shadow-4.0.9
http://www.linuxfromscratch.org/ ... postlfs/shadow.html

satimis
回复 支持 反对

使用道具 举报

发表于 2005-8-26 16:09:44 | 显示全部楼层
恩,自己建立一个目录。。我忘记是什么时候建立的了,,2个月没lfs了。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表