我使用AD作为我的用户帐户服务器ldap。
大多数服务器运行UsePam是除了这一个,
root@linserv9:~# ldd /usr/sbin/sshd linux-vdso.so.1 => (0x00007fff621fe000) libutil.so.1 => /lib/libutil.so.1 (0x00007fd759d0b000) libz.so.1 => /usr/lib/libz.so.1 (0x00007fd759af4000) libnsl.so.1 => /lib/libnsl.so.1 (0x00007fd7598db000) libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0x00007fd75955b000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007fd759323000) libc.so.6 => /lib/libc.so.6 (0x00007fd758fc1000) libdl.so.2 => /lib/libdl.so.2 (0x00007fd758dbd000) /lib64/ld-linux-x86-64.so.2 (0x00007fd759f0e000)
我已经安装了这个软件包
root@linserv9:~# dpkg -l|grep -E 'pam|ssh' ii denyhosts 2.6-2.1 an utility to help sys admins thwart ssh hac ii libpam-modules 0.99.7.1-5ubuntu6.1 Pluggable Authentication Modules for PAM ii libpam-runtime 0.99.7.1-5ubuntu6.1 Runtime support for the PAM library ii libpam-ssh 1.91.0-9.2 enable SSO behavior for ssh and pam ii libpam0g 0.99.7.1-5ubuntu6.1 Pluggable Authentication Modules library ii libpam0g-dev 0.99.7.1-5ubuntu6.1 Development files for PAM ii openssh-blacklist 0.1-1ubuntu0.8.04.1 list of blacklisted OpenSSH RSA and DSA keys ii openssh-client 1:4.7p1-8ubuntu1.2 secure shell client, an rlogin/rsh/rcp repla ii openssh-server 1:4.7p1-8ubuntu1.2 secure shell server, an rshd replacement ii quest-openssh 5.2p1_q13-1 Secure shell root@linserv9:~#
我做错了什么?
谢谢。
编辑:
root@linserv9:~# cat /etc/pam.d/sshd # PAM configuration for the Secure Shell service # Read environment variables from /etc/environment and # /etc/security/pam_env.conf. auth required pam_env.so # [1] # In Debian 4.0 (etch), locale-related environment variables were moved to # /etc/default/locale, so read that as well. auth required pam_env.so envfile=/etc/default/locale # Standard Un*x authentication. @include common-auth # Disallow non-root logins when /etc/nologin exists. account required pam_nologin.so # Uncomment and edit /etc/security/access.conf if you need to set complex # access limits that are hard to express in sshd_config. # account required pam_access.so # Standard Un*x authorization. @include common-account # Standard Un*x session setup and teardown. @include common-session # Print the message of the day upon successful login. session optional pam_motd.so # [1] # Print the status of the user's mailbox upon successful login. session optional pam_mail.so standard noenv # [1] # Set up user limits from /etc/security/limits.conf. session required pam_limits.so # Set up SELinux capabilities (need modified pam) # session required pam_selinux.so multiple # Standard Un*x password updating. @include common-password
编辑2:UsePAM是失败
有了这个configurationssh无法启动:
root@linserv9:/home/admmarc# cat /etc/ssh/sshd_config |grep -vE "^[ \t]*$|^#" Port 22 Protocol 2 ListenAddress 0.0.0.0 RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys ChallengeResponseAuthentication yes UsePAM yes Subsystem sftp /usr/lib/sftp-server root@linserv9:/home/admmarc#
它给出的错误如下
root@linserv9:/home/admmarc# /etc/init.d/ssh start * Starting OpenBSD Secure Shell server sshd /etc/ssh/sshd_config: line 75: Bad configuration option: UsePAM /etc/ssh/sshd_config: terminating, 1 bad configuration options ...fail! root@linserv9:/home/admmarc#
它看起来像/usr/sbin/sshd二进制文件已被覆盖。
这可能意味着你有安全漏洞,也可能是某个人在本地编译了一个版本,Ubuntu版本被覆盖。
openssh-server的1:4.7p1-8ubuntu1.2 (x86)版本肯定与libpam链接。 可以想象的是,pam的支持被排除在64位版本之外,但似乎不太可能。
我会尝试重新安装openssh服务器:
# First back up the current binary $ sudo cp /usr/sbin/sshd /root/sshd.bak # reinstall the Ubuntu version $ sudo apt-get install --reinstall openssh-server # compare the two versions $ sudo sha1sum /usr/sbin/sshd /root/sshd.bak # In my case, they match: # 8a3ccd5242380674bc45b887286faa3abb51acdb /usr/sbin/sshd # 8a3ccd5242380674bc45b887286faa3abb51acdb /root/sshd.bak
如果你的不匹配(不是我的),肯定会有一些鱼腥味,你真的需要弄清楚sshd版本来自哪里。
如果他们匹配,那么我可能是错误的,这是在64位Ubuntu的openssh服务器版本中的错误。
根据问题提供的信息,它看起来像你的sshd覆盖可能不是由于系统的妥协,但由于更像一个系统pipe理员试图改变标准ssh的良性。 我怀疑这是一些pipe理员行为的原因是系统也安装了这个非标准的ssh软件包:
quest-openssh 。
你可以运行:
dpkg-query -L quest-openssh | grep sshd
看看这个软件包是否包含一个覆盖你的openssh服务器的文件/usr/bin/sshd (根据Theward和我的validation,在/ opt下查询openssh安装,但是configuration不同)。 无论如何,你应该询问你的系统pipe理员是否试图用什么,如何以及为什么replacesshd 。
总结一下我的想法:是的,你的sshd已经被覆盖了,但是我认为你的系统肯定受到了损害,这有点仓促。
最后:如何解决? 删除quest-openssh软件包,重新安装标准openssh和ldap-auth-client ,它使用标准openssh的libpam-ldap支持。 通常,在基于debian / ubuntu的系统上,很less需要安装非标准或非自由的商业软件包来获得开放/标准function。 你可以在这里find更多关于如何设置LDAP的openssh PAM的信息: http : //wiki.linuxquestions.org/wiki/Pam_ldap
/etc/pam.d/sshd是否存在? 这是openssh-server的一部分。
如果你的系统真的受到影响,系统重新安装可能就会顺利!