'Buster of World'에 해당되는 글 449건

  1. 2013.09.14 centos openssh 소스 컴파일시 zlib error
  2. 2013.09.14 centos mysql 설치
  3. 2013.09.14 tomcat 80포트를 8080 포트로 리다이렉팅 하는 법
  4. 2013.09.14 iptables
IT2013. 9. 14. 20:43
반응형


centos openssh  소스 컴파일시 zlib  error

발생시 다음과 같이 진행 하시오



configure: error: *** zlib.h missing - please install first or check config.log ***


[root@santafe openssh-6.2p2]# yum -y install zlib-devel 

 Installing : 1:pkgconfig-0.23-9.1.el6.i686                                                         1/2

  Installing : zlib-devel-1.2.3-29.el6.i686                                                          2/2

  Verifying  : 1:pkgconfig-0.23-9.1.el6.i686                                                         1/2

  Verifying  : zlib-devel-1.2.3-29.el6.i686                                                          2/2


[root@santafe openssh-6.2p2]# yum -install openssl-devel
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: ftp.neowiz.com
 * extras: ftp.neowiz.com
 * updates: ftp.neowiz.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package openssl-devel.i686 0:1.0.0-27.el6_4.2 will be installed
--> Processing Dependency: krb5-devel for package: openssl-devel-1.0.0-27.el6_4.2.i686
--> Running transaction check
---> Package krb5-devel.i686 0:1.10.3-10.el6_4.6 will be installed
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.10.3-10.el6_4.6.i686
--> Processing Dependency: libcom_err-devel for package: krb5-devel-1.10.3-10.el6_4.6.i686
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.10.3-10.el6_4.6.i686
--> Running transaction check
---> Package keyutils-libs-devel.i686 0:1.4-4.el6 will be installed
---> Package libcom_err-devel.i686 0:1.41.12-14.el6_4.2 will be installed
---> Package libselinux-devel.i686 0:2.0.94-5.3.el6_4.1 will be installed
--> Processing Dependency: libsepol-devel >= 2.0.32-1 for package: libselinux-devel-2.0.94-5.3.el6_4.1.i686
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.0.94-5.3.el6_4.1.i686
--> Running transaction check
---> Package libsepol-devel.i686 0:2.0.41-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================
 Package                        Arch            Version                         Repository          Size
=========================================================================================================
Installing:
 openssl-devel                  i686            1.0.0-27.el6_4.2                updates            1.1 M
Installing for dependencies:
 keyutils-libs-devel            i686            1.4-4.el6                       base                28 k
 krb5-devel                     i686            1.10.3-10.el6_4.6               updates            493 k
 libcom_err-devel               i686            1.41.12-14.el6_4.2              updates             31 k
 libselinux-devel               i686            2.0.94-5.3.el6_4.1              updates            136 k
 libsepol-devel                 i686            2.0.41-4.el6                    base                64 k

Transaction Summary
=========================================================================================================
Install       6 Package(s)

Total download size: 1.9 M
Installed size: 4.7 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 1.9 M
(1/6): keyutils-libs-devel-1.4-4.el6.i686.rpm                                     |  28 kB     00:00
(2/6): krb5-devel-1.10.3-10.el6_4.6.i686.rpm                                      | 493 kB     00:03
(3/6): libcom_err-devel-1.41.12-14.el6_4.2.i686.rpm                               |  31 kB     00:00
(4/6): libselinux-devel-2.0.94-5.3.el6_4.1.i686.rpm                               | 136 kB     00:01
(5/6): libsepol-devel-2.0.41-4.el6.i686.rpm                                       |  64 kB     00:00
(6/6): openssl-devel-1.0.0-27.el6_4.2.i686.rpm                                    | 1.1 MB     00:07
---------------------------------------------------------------------------------------------------------
Total                                                                    131 kB/s | 1.9 MB     00:14
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libsepol-devel-2.0.41-4.el6.i686                                                      1/6
  Installing : libselinux-devel-2.0.94-5.3.el6_4.1.i686                                              2/6
  Installing : libcom_err-devel-1.41.12-14.el6_4.2.i686                                              3/6
  Installing : keyutils-libs-devel-1.4-4.el6.i686                                                    4/6
  Installing : krb5-devel-1.10.3-10.el6_4.6.i686                                                     5/6
  Installing : openssl-devel-1.0.0-27.el6_4.2.i686                                                   6/6
  Verifying  : keyutils-libs-devel-1.4-4.el6.i686                                                    1/6
  Verifying  : libcom_err-devel-1.41.12-14.el6_4.2.i686                                              2/6
  Verifying  : krb5-devel-1.10.3-10.el6_4.6.i686                                                     3/6
  Verifying  : libselinux-devel-2.0.94-5.3.el6_4.1.i686                                              4/6
  Verifying  : openssl-devel-1.0.0-27.el6_4.2.i686                                                   5/6
  Verifying  : libsepol-devel-2.0.41-4.el6.i686                                                      6/6

Installed:
  openssl-devel.i686 0:1.0.0-27.el6_4.2

Dependency Installed:
  keyutils-libs-devel.i686 0:1.4-4.el6                krb5-devel.i686 0:1.10.3-10.el6_4.6
  libcom_err-devel.i686 0:1.41.12-14.el6_4.2          libselinux-devel.i686 0:2.0.94-5.3.el6_4.1
  libsepol-devel.i686 0:2.0.41-4.el6


[root@santafe openssh-6.2p2]# yum install make


[root@santafe openssh-6.2p2]# ./configure --prefix=/usr/local/ssh --with-ssl-dir=/usr/local/ssl






반응형

'IT' 카테고리의 다른 글

vsftpd 접속 500 oops error 대처법  (0) 2013.09.14
umask 설정  (0) 2013.09.14
tomcat 80포트를 8080 포트로 리다이렉팅 하는 법  (0) 2013.09.14
iptables  (0) 2013.09.14
톰켓 시작 데몬 등록  (0) 2013.09.14
Posted by Dream Come True
카테고리 없음2013. 9. 14. 20:27
반응형
yum install mysql-server

MySQL 서버를 실행시키려면 다음과 같이 명령합니다.

service mysqld start

설치하고 나서 가장 먼저 설정할 것은 root 사용자의 비밀번호입니다. 다음과 같이 명령하여 MySQL에 접속합니다.

mysql -u root -p mysql

비밀번호를 입력하하고 하는데, 비밀번호 설정이 안 되어있으므로 그냥 엔터를 칩니다. 그리고 다음과 같이 명령하여 root의 비밀번호를 생성합니다. (new-password 대신에 원하는 비밀번호를 넣으세요.)

update user set password=password('new-password') where user='root';

이제 권한 테이블을 업데이트합니다.

flush privileges;

다음과 같이 명령하여 MySQL에서 나옵니다.

quit;

MySQL 작업은 명령어로 할 수도 있고, phpMyAdmin 같은 도구를 이용하여 할 수도 있습니다.

데이터베이스 생성

 mysql> create database DB명;

MySQL에서 새로운 사용자 추가

MySQL에서 사용할 Database를 만든 후에 사용자를 추가하려면, 일단 root로 접속한 후

 $ mysql (?h localhost) ?u root ?p
 Enter password: *******

 mysql> use mysql
 mysql> INSERT INTO user VALUES('%', '사용자', PASSWORD('비밀번호'),
     -> 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');

이렇게 해서 사용자를 하나 만들었습니다. 맨 처음 ‘%’ 가 붙은 것은 다른 어느 호스트에서도 접속이 가능하게 하기 위해서 입니다. 간단하게 추가 하는 방법이 있습니다.


'GRANT' 명령을 이용하면 쉽게 사용자 추가 및 권한 설정이 가능합니다. (MySQL Manual 4.3.5)

  • 일반 사용자 추가
 mysql> grant all privileges on dbuser.* to dbuser@localhost identified by 'password' with grant option;

  • 특정 이름의 데이터베이스에 대한 모든 권한을 가지는 사용자 추가
 mysql> grant all privileges on `dbuser_%`.* to dbuser@localhost identified by 'password' with grant option;

'dbuser_'으로 시작되는 데이터베이스에 대한 모든 권한을 가지는 'dbuser' 사용자 계정 추가%%% 이런식으로 계정을 만들면 새로운 사용자에 대한 개별적인 데이터베이스 권한 설정을 생략할 수 있습니다. -- 이현진


사용자에게 Database 사용 권한을 주기

 mysql> INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
     -> VALUES('%', 'DB명', '사용자', 'Y', 'Y', 'Y', 'Y','Y','Y');

모든 권한을 준다면 아래와 같은 방법을 하는것이 더욱 편리힙니다.

 mysql> GRANT ALL on DB명.* TO id@'localhost'  ;
 mysql> GRANT ALL on DB명.* TO id;
 mysql> GRANT ALL on DB명.* TO id@'xxx.xxx.xxx.%';

첫번째 localhost?로컬 호스트 (DB가 자기컴퓨터에 깔려 있는경우..에만 접속을 허용하겠다는 뜻입니다.

두번째 문장은 로컬 호스트를 제외하고는 모든 ip에서 접근을 시키겠다는 내용입니다.

세번째는 c클래스만 허용하겠다는 의미 입니다. xxx.xxx.%.% 면 B클래스 xxx.%.%.%면 A클래스로 제한을 할수 있습니다.

그리고 변경된 내용을 메모리에 반영하기 위해 다음 명령을 실행합니다.

 mysql> FLUSH PRIVILEGES;

이렇게 MySQL을 설정해 놓으면 사용자가 다른 호스트에서도 접속할 수 있고 테이블 추가 삭제 등도 할 수 있습니다.


이렇게 수동으로도 가능 하지만 요즘은 툴을 많이 사용합니다. 툴은 DB에 대한 기본적인 지식만 있으면 무리가 없이 사용 되는 녀석이죠 ^^%%% 저같이 쿼리에 약한 사람들에게는 정말 유리 합니다. 아래 페이지에 가셔서 다운로드를 받으세요 :) 한글 사용에 약간의 제약이 있습니다.%%% 다른 여러가지 DB관리 툴이 있지만 상당히 고가의 툴이랍니다 :) 암흑의 루트에서 돌고 있는 녀석들이 종종 있습니다.






반응형
Posted by Dream Come True
IT2013. 9. 14. 13:26
반응형

First verify that Tomcat is running on port 8080. Run the following command

# netstat -ntl

The output will look something like

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 ::ffff:127.0.0.1:8005       :::*                        LISTEN
tcp        0      0 :::8009                     :::*                        LISTEN
tcp        0      0 :::8080                     :::*                        LISTEN
tcp        0      0 :::22                       :::*                        LISTEN

Run the following command to redirect port 80 traffic to port 8080

# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

Run the folloing command to verify that redirect is working fine

# iptables -t nat -L

The output will look something like

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
REDIRECT   tcp  --  anywhere             anywhere            tcp dpt:http redir ports 8080

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

Run the following command to remove the routing

# iptables -t nat -D PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080


다른 방법 아래

/etc/sysconfig/iptables


iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080


반응형

'IT' 카테고리의 다른 글

umask 설정  (0) 2013.09.14
centos openssh 소스 컴파일시 zlib error  (0) 2013.09.14
iptables  (0) 2013.09.14
톰켓 시작 데몬 등록  (0) 2013.09.14
솔라리스 reboot 없이 네트웍 재시작  (0) 2013.09.11
Posted by Dream Come True
IT2013. 9. 14. 12:43
반응형

2. 21.23.25.80 포트를 차단하는 정책(각각 하나씩 규칙을 만들것)

iptables -A INPUT -p tcp --dport 21 -j DROP

iptables -A INPUT -p tcp --dport 23 -j DROP

iptables -A INPUT -p tcp --dport 25 -j DROP

iptables -A INPUT -p tcp --dport 80 -j DROP




0. 기본정책을 ACCEPT로 설정

iptables -P INPUT ACCEPT

iptables -P OUTPUT ACCEPT

iptables -P FORWARD ACCEPT



6. 출발지 IP 192.168.10.1 부터 192.168.10.100, 그리고 192.168.150.0/24이고 목적지IP 는 192.168.10.170이고 목적지 포트는 3306일 경우 차단하는 정책

 

iptables -A INPUT -p tcp -s 192.168.150.0/24 -d 192.168.10.170 --dport 3306 -j DROP

iptables -A INPUT -p tcp -m iprange --src-range 192.168.10.1-192.168.10.100 -d 192.168.10.170 --dport 3306 -j DROP



# 허용할 IP

iptables -A -i eth0 -s 192.168.0.1 -j ACCEPT

iptables -A -i eth0 -s 192.168.0.2 -j ACCEPT

...

iptables -A -i eth0 -s 192.168.0.10 -j ACCEPT


# 나머지 모든 것을 막음.

iptables -A INPUT -j REJECT




jlp--smaple 

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

#***********************************
#80 CONNECT --> 8080 REDIRECT BY JLP
#***********************************
-A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT



반응형
Posted by Dream Come True