참조:http://webnautes.tistory.com/194

zlib

localhost opt # wget http://www.gzip.org/zlib/zlib-1.2.3.tar.gz

localhost opt # tar xvzf zlib-1.2.3.tar.gz

localhost opt # cd zlib-1.2.3

localhost zlib-1.2.3 # CC=arm-linux-gcc AR="arm-linux-ar rc" RANLIB=arm-linux-ranlib ./configure --shared --prefix=$PWD/build

localhost zlib-1.2.3 # make && make install


openssl

다운로드 http://www.openssl.org/source/

localhost opt # wget http://www.openssl.org/source/openssl-0.9.8e.tar.gz

localhost opt # tar xvzf openssl-0.9.7a.tar.gz

localhost opt # cd openssl-0.9.7a

localhost openssl-0.9.7a #vi Configure
Configure파일 수정
 "linux-elf" "gcc, ...................." <- 이부분을 찾아 다음처럼 수정한다.
=> "linux-elf-arm" "arm-linux-gcc,............." 변경후 아래를 실행한다.

localhost openssl-0.9.7a #./Configure linux-elf-arm --prefix=/usr/local/openssl-arm --openssldir=/usr/local/openssl-arm -L/opt/zlib-1.2.3/build/lib shared no-threads no-asm

Make File 수정
-CC= gcc
+CC= arm-linux-gcc
-EX_LIBS=
+EX_LIBS= -ldl
-AR=ar $(ARFLAGS) r
-RANLIB= /usr/bin/ranlib
+AR=arm-linux-ar $(ARFLAGS) r
+RANLIB= arm-linux-ranlib

make
make install



openssh

localhost opt # wget ftp://ftp.iij.ad.jp/pub/OpenBSD/OpenSSH/portable/openssh-4.6p1.tar.gz

localhost opt # tar xvzf openssh-4.6p1.tar.gz

localhost opt # cd openssh-4.6p1

localhost openssh-4.6p1 # CC=arm-linux-gcc AR=arm-linux-ar ./configure --prefix=/nfsroot/openssh --sysconfdir=/nfsroot/openssh/etc/ssh --target=arm-linux --host=arm-linux --with-ldflags="-static-libgcc" --with-zlib=/opt/zlib-1.2.3/build --disable-etc-default-login --disable-lastlog  --with-ssl-dir=/usr/local/openssl-arm --with-libs="-L/usr/local/openssl-arm/lib" --disable-strip  --without-pam --with-pid-dir=/nfsroot/openssh --with-privsep-path=/nfsroot/openssh/empty

make
make install


make install 실행 도중에 아래와 같은 에러가 난다. arm용으로 컴파일 된 실행파일을  PC에서 실행시키려 했기 때문이다.

/bin/sh: line 4: ./ssh-keygen: cannot execute binary file
/bin/sh: line 9: ./ssh-keygen: cannot execute binary file
/bin/sh: line 14: ./ssh-keygen: cannot execute binary file
make: *** [host-key] 오류 126


make파일을 arm용으로 컴파일 하여 계속 진행하였다.

타겟보드에서 make host-key라고 명령을 내린다.
./ssh-keygen: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
./ssh-keygen: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
./ssh-keygen: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
make: *** [host-key] Error 127

기존에 컴파일 해두었던 libz.so.1을 타겟보드의 /lib/로 복사한후 계속 진행한다.
localhost lib # pwd
/opt/zlib-1.2.3/build/lib
localhost lib # cp -a * /nfsroot/
localhost lib # ls -l /nfsroot/

타겟보드에서
# cp -a /nfsroot/libz.so* /lib/


make host-key
에러가 나면 현재시간을 다시 맞추어주자..
make: warning:  Clock skew detected.  Your build may be incomplete.

# date
Thu Jan  1 01:08:41 UTC 1970
# date 062911382007   
Fri Jun 29 11:38:00 UTC 2007


ssh_conf파일을 수정해야 한다. 옵션설정은 더봐야함
[root@acumen:ssh]# pwd
/nfsroot/openssh/etc/ssh
[root@acumen:ssh]# vim ssh_config

38줄 SSH1 또는 SSH2 사용여부..#을 제거한다.
#   Protocol 2,1 -> Protocol 2,1


타겟 보드에서 sshd를 실행시킨다.
/nfsroot/openssh/sbin/sshd


PC에서 접속을 해본다.
ssh 192.168.1.166

+ Recent posts