Linux中国 Linux中国门户站!
设为主页 设为主页
收藏本站 收藏本站
 
当前位置 :首页 ->Linux技术 ->Linux安全 ->正文

利用BusyBox定制Linux Live CD

来源:Linux时代 作者:Mike Chirico  时间:2007-04-22 点击: [收藏] [投稿]

  $ ldd /usr/bin/ssh
     libcrypto.so.4 => /lib/libcrypto.so.4 (0x003b8000)
     libutil.so.1 => /lib/libutil.so.1 (0x00dee000)
     libz.so.1 => /usr/lib/libz.so.1 (0x00827000)
     libnsl.so.1 => /lib/libnsl.so.1 (0x00d9b000)
     libcrypt.so.1 => /lib/libcrypt.so.1 (0x06182000)
     libselinux.so.1 => /lib/libselinux.so.1 (0x00db3000)
     libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00d28000)
     libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00c95000)
     libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00cfc000)
     libcom_err.so.2 => /lib/libcom_err.so.2 (0x00c90000)
     libresolv.so.2 => /lib/libresolv.so.2 (0x00966000)
     libc.so.6 => /lib/tls/libc.so.6 (0x00607000)
     libdl.so.2 => /lib/libdl.so.2 (0x00758000)
     /lib/ld-linux.so.2 (0x005ee000)

As you can see above, these are all the libraries needed by ssh. However, again, you have been slightly misled, as there is no listing for "/lib/libnss_*".

All of the dynamically libraries need to be copied. Below is a complete listing of all libraries copied. You will need to copy them from your system or from the proj1 developer environment.

  $ cd <into the proj1 directory>
  $ find . -iname '*\.so\.*'
  ./_install/usr/lib/libz.so.1
  ./_install/usr/lib/libkrb5.so.3
  ./_install/usr/lib/libgssapi_krb5.so.2
  ./_install/usr/lib/libk5crypto.so.3
  ./_install/lib/libutil.so.1
  ./_install/lib/libacl.so.1
  ./_install/lib/libcrypt.so.1
  ./_install/lib/libselinux.so.1
  ./_install/lib/libpam.so.0
  ./_install/lib/libcrypto.so.4
  ./_install/lib/libdl.so.2
  ./_install/lib/ld-lsb.so.1
  ./_install/lib/libcom_err.so.2
  ./_install/lib/libnss_dns.so.1
  ./_install/lib/libpam_misc.so.0
  ./_install/lib/libnsl.so.1
  ./_install/lib/tls/libc.so.6
  ./_install/lib/libm.so.6
  ./_install/lib/libnss_files.so.2
  ./_install/lib/libattr.so.1
  ./_install/lib/libnss_dns.so.2
  ./_install/lib/ld-linux.so.2
  ./_install/lib/libnss_files.so.1
  ./_install/lib/libresolv.so.2


STEP 7: Compiling and Configuring SSH

Download ssh, configure and make. Next, all files must be installed in the into the respective "_install/*" directories, without changing the keys, configs, or other files installed on your running environment. Furthermore, you'll need to have all the libraries linked correct. Basically, this means running "make install" in a "chroot" environment. But, if you "chroot", "/bin/bash" cannot be found. Plus, there are a few lib's needed with make.

Download the latest version of openssh. Note you should check the signed keys.

       $ wget http://mirror.mcs.anl.gov/openssh/portable/openssh-3.9p1.tar.gz 

[**** Special Security Note ****]

In general it's good to verify keys with a trusted signature. Not covered here; but, it is something like the following. You'll need gpg. See Linux Tips in the reference.

  $ wget http://mirror.mcs.anl.gov/openssh/portable/openssh-3.9p1.tar.gz.sig
  $ wget http://mirror.mcs.anl.gov/openssh/portable/DJM-GPG-KEY.asc
  $ gpg --import DJM-GPG-KEY.asc
  $ gpg --verify openssh-3.9p1.tar.gz.sig  openssh-3.9p1.tar.gz

[**** End Special Security Note *]

If you are working in the "proj1" directory that was downloaded, you'll need to clear out any existing ssh file.

  $ cd proj1
  $ find _install/usr/ -iname 'ssh*' -exec rm -f {} \;
  $ find _install/etc/ -iname 'ssh*' -exec rm -f {} \;
  $ find _install/bin/ -iname 'ssh*' -exec rm -f {} \;
  $ find _install/sbin/ -iname 'ssh*' -exec rm -f {} \;

Reference the file "proj1/removeSSH".

Note, do this in the "proj1/_install" directory as root.

  $ su -
  $ cd proj1/_install
  $ cp <location of openssh>  .
  $ tar -xzf openssh-3.9p1.tar.gz        
  $ cd openssh-3.9p1
  $ ./configure --prefix=

This should leave you with the following. Note the location of the User binaries and "System binaries" when using "--prefix=" without any directory specified.

         
         OpenSSH has been configured with the following options:
                              User binaries: /bin
                            System binaries: /sbin
                        Configuration files: /etc
                            Askpass program: /libexec/ssh-askpass
                               Manual pages: /man/manX
                                   PID file: /var/run
           Privilege separation chroot path: /var/empty
                     sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin
                             Manpage format: doc
                                PAM support: no
                          KerberosV support: no
                          Smartcard support: no
                              S/KEY support: no
                       TCP Wrappers support: no
                       MD5 password support: no
                IP address in $DISPLAY hack: no
                    Translate v4 in v6 hack: yes
                           BSD Auth support: no
                       Random number source: OpenSSL internal ONLY
         
                       Host: i686-pc-linux-gnu
                   Compiler: gcc
             Compiler flags: -g -O2 -Wall -Wpointer-arith -Wno-uninitialized
         Preprocessor flags:
               Linker flags:
                  Libraries:   -lcrypto -lutil -lz -lnsl  -lcrypt
 

 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<



上一篇:基于FreeBSD5.4全能服务器安装v1.01   下一篇:使用 Perl 自动化 UNIX 系统管理

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章
Power by linux-cn.com 粤ICP备05006655号