블로그 이미지
은총애비!!

카테고리

분류 전체보기 (2525)
Linux (35)
Error 해결 방법 (5)
소소한 일상 (1620)
사진실 (0)
책책책, 책을 읽읍시다!! (21)
기타(JSP & DB & 등등) (4)
미국 주식 관련 (541)
아침형 인간 프로젝트 (292)
Total
Today
Yesterday
반응형

[Linux Server] OpenSSH Source Compile

 

설치 전 사항 : pam-devel 패키지 설치 및 업데이트

 

설치 순서

1. openssh 다운로드

2. 기존 openssh 패키지 삭제

3. ./configure

4. make & make install

5. 파일 복사 & 부팅시 자동 실행 등록

 

「현재 OpenSSL 버전 확인」

[root@localhost qual]# ssh -V

OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010

[root@localhost qual]#

 

1. openssh 다운로드

「https://www.openssh.com/portable.html 에서 다운 받습니다.」

「홈페이지에서 최신 버전을 확인 후

http://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.6p1.tar.gz 뒤의 버전 부분을 수정해도 최신버전으로 다운 받습니다.」

 

 

[root@localhost qual]# wget http://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.6p1.tar.gz

--2017-10-11 00:01:00-- http://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openss h-7.6p1.tar.gz

Resolving fastly.cdn.openbsd.org... 151.101.74.49, 2a04:4e42:11::561

Connecting to fastly.cdn.openbsd.org|151.101.74.49|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 1489788 (1.4M) [text/plain]

Saving to: `openssh-7.6p1.tar.gz.1'

 

100%[================================================>] 1,489,788 1.32M/s in 1.1s

 

2017-10-11 00:01:02 (1.32 MB/s) - `openssh-7.6p1.tar.gz.1' saved [1489788/1489788]

 

[root@localhost qual]#

 

 

2. 기존 openssh 패키지 삭제

「우선 rpm으로 openssh 설치 된 것들을 지운다.」

[root@localhost qual]# rpm -qa |grep openssh

openssh-server-5.3p1-20.el6.i686

openssh-clients-5.3p1-20.el6.i686

openssh-5.3p1-20.el6.i686

openssh-askpass-5.3p1-20.el6.i686

[root@localhost qual]# rpm -e --nodeps openssh-server-5.3p1-20.el6.i686

 

 

 

「의존성 때문에 순서대로 지워야 하지만 의존성 무시하고 지워도 됩니다.(rpm -e --nodeps 패키지명)

 

패키지를 삭제하고나면 ssh 서비스를 중지하고 텔넷이나 서버에서 아래와 같이 작업을 해야 합니다.

서비스 중지 : service sshd stop

 

3. ./configure

[root@localhost openssh-7.6p1]# ./configure --prefix=/usr/local/openssh --with-ssl-dir=/usr/local/openssl/bin --with-tcp-wrappers --with-pam --with-md5-passwords

 

--prefix= : SSH 설치 경로

--with-ssl-dir= : SSL 설치 디렉토리 ----------> 정말 중요!!

--with-md5-passwords : MD5 암호화 알고리즘을 사용해서 더 안정적인 보안을 제공

 

 

 

사실 이 에러 OpenSSL library 때문에 정말 고생 많았다. 그래서 OpenSSL을 다시 설치하길 몇번이나 했는지..ㅠ,.ㅠ 어째든 이 에러 때문에 OpenSSL prefix를 다시 설정 해주니 된다.

 ./configure 에서 --with-ssl-dir=/usr/local/openssl/bin  <- 이부분 만 잘 해주면 된다. 그럼 아래와 같은 에러는 절대 없다!!

 

 

 

4. make & make install

[root@localhost openssh-7.6p1]# make && make install

 

 

5. 파일 복사 & 부팅시 자동 실행 등록

「contrib 디렉토리에 sshd.pam.generic 파일을 /etc/pam.d sshd 로 복사」

[root@localhost openssh-7.6p1]# cp ./contrib/sshd.pam.generic /etc/pamd.sshd

 

「실행」

[root@localhost openssh-7.6p1]# /usr/local/openssh/sbin/sshd

 

「부팅시 자동 실행」

[root@localhost openssh-7.6p1]# vi /etc/rc.d/rc.local 마지막 부분에 추가

/usr/local/openssh/sbin/sshd &

 

 

 

설정 마치고 다시 접속 하니 처음 접하는 화면

 

 

 

로그인 하고 설치된 버전 확인!!

 

 

 

PAM 패키지 때문에 에러. yum -y install pam-devel 해주면 된다.

 

이상 OpenSSH Source Compile 끝!!

반응형
Posted by 은총애비!!
, |
반응형

[Linux] apache & tomcat connectors 연동 configure중 에러 해결 방법

 

apache & tomcat connectors 연동중  make중

make: *** 타겟이 지정되지 않았고 메이크파일이 없습니다.  멈춤.

에러에 관한 내용입니다.

 

checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
[root@localhost native]# make && make install
make: *** 타겟이 지정되지 않았고 메이크파일이 없습니다.  멈춤.
[root@localhost native]#

 

yum -y install gcc-c++ libstdc++-devel

 

또는

 

yum -y install gcc*

 

설치를 해줍니다...

 

그러면 configure가 에러 없이 잘 끝날겁니다...

 

configure: creating ./config.status
config.status: creating Makefile
config.status: creating apache-1.3/Makefile
config.status: creating apache-1.3/Makefile.apxs
config.status: creating apache-2.0/Makefile
config.status: creating apache-2.0/Makefile.apxs
config.status: creating common/Makefile
config.status: creating common/list.mk
config.status: creating common/jk_types.h
config.status: creating common/config.h
config.status: executing depfiles commands  => 에러 없이 잘 끝났습니다.
[root@localhost native]# make && make install
Making all in common => make가 시작 됩니다.
make[1]: Entering directory `/home/qual/tomcat-connectors-1.2.37-src/native/common'
/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -I/usr/local/src/apache/include  -DHAVE_CONFIG_H -pthread -DHAVE_APR  -I/usr/include/apr-1 -I/usr/include/apr-1  -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -c jk_ajp12_worker.c -o jk_ajp12_worker.lo
/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -I/usr/local/src/apache/include  -DHAVE_CONFIG_H -pthread -DHAVE_APR  -I/usr/include/apr-1 -I/usr/include/apr-1  -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -c jk_connect.c -o jk_connect.lo
/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -I/usr/local/src/apache/include  -DHAVE_CONFIG_H -pthread -DHAVE_APR  -I/usr/include/apr-1 -I/usr/include/apr-1  -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -c jk_msg_buff.c -o jk_msg_buff.lo
/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -I/usr/local/src/apache/include  -DHAVE_CONFIG_H -pthread -DHAVE_APR  -I/usr/include/apr-1 -I/usr/include/apr-1  -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -c jk_util.c -o jk_util.lo

반응형
Posted by 은총애비!!
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함