반응형


후암..


간만에 설정하려고 하니 뭐가 이리 복잡 -_-...


정확한 자료도 없고...


다음과 같이 정리함.


참고 :http://www.tecmint.com/setup-samba-server-using-tdbsam-backend-on-rhel-centos-6-3-5-8-and-fedora-17-12/


1 단계 준비 노트

 서버의 호스트 명 tecmint 이며 IP는 172.16.25.126 임


2. SELinux 설정을 끔

 다음과 같은 명령으로 설정/비설정 확인 가능함

 ※ 강화된 보안설정으로 작업시 불편이 많다... 대외적(공용망 등 서비스 상태가 아닌 내부용이라면 끄고 설정하는것이 편하다)


 아래는 설정된 상태

 # selinuxenabled && echo enabled || echo disabled
enabled


RHEL 계열은 /CentOS/Fedora 이며 /etc/selinux/config를 에디터로 연다.

vi /etc/selinux/config


SELINUX=enabled 설정을 SELINUX=disabled 설정으로 바꾸고 리부팅한다.



# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted 


3 단계 재부팅

# init 6


4 단계 삼바 설치

# yum install samba samba-common cups-libs samba-client


5 단계 tdbsam Backend 로 삼바 설정하기

# vi /etc/samba/smb.conf


global 설정 부분

 [global] 

# 워크그룹이름은 맘대로 정한다.

workgroup = WORKGROUP


# 윈도우에서 보이는 서버 이름

netbios name = FILEServer


# 접근을 허락할 아이피 범위 (B Class 까지는 층의 변화가 없음)

hosts allow = 172.16.


# 언어셋 설정

unix charset = UTF-8

dos charset = 949

smb port = 139

server string = Public Sector Business 3 Team


# 특정 이더넷 카드만 지원

# interfaces = eth0


## 특정 계정만 접근시키고 싶을 때

# 1. smbpasswd 를 통한 계정 추가 방식

security = user

passdb backend = tdbsam



6 단계 공유 디렉토리 생성

# mkdir -p /share/20130121

# chown -R root:users /share/20130121

# chmod -R 775 /share/20130121


7 단계 공유 디렉토리 지정

공유 폴더 지정 부분

# vi /etc/samba/smb.conf

project 명으로 공유 

* 네트워크 상에서 폴더 정보가 보일수 있도록 browseable 를 yes로 함.

 [tecmintusers]

        comment = Testproject

        path = /share/20130121

        valid users=@users

        force group=users

        create mask = 0660

        directory mask = 0771

        writable = yes

        browseable = yes


        

8 단계 재부팅시 삼바가 기동 되도록 설정
# chkconfig --list 235 smb on

9 단계 삼바 재시작
# /etc/init.d/smb restart


or

# service smb restart

10 단계 삼바 사용자 생성
# useradd project -G users (users 그룹에 project 사용자 생성)
# passwd project (project 계정의 비밀번호 설정 -> 로그인 비밀번호 이며 삼바 비번과는 다름)

삼바 비밀번호 설정
# smbpasswd -a project (project의 삼바 비밀번호를 입력하여 확인한다)

*** 참고
사용자 추가 / 삭제 / 중지
# smbpasswd -a 계정 : 계정 추가
# smbpasswd -x 계정 : 계정 삭제
# smbpasswd -d 계정 : 계정 중지
-> 위 작업후 삼바 재시작 필요함.

11 단계 삼바 공유 검증
# smbclient -L tecmint (즉 서버 명으로 접근되는지 확인 명령)
  비밀번호 입력하라고 하면 엔터 땅!

- 공유 폴더 접근 되는지 확인
# smbclinet -L //tecmint/project -U project (위의 생성 계정)
비밀번호 입력(smbpasswd 를 통해 입력한 비밀번호 입력)
정보 좌악..

12 단계 윈도우즈에서 삼바서버로 로그인하기
\\172.16.25.126\project 자신의 local 폴더와
\\172.16.25.126\tecmintusers 의 공유 폴더 접근이 가능하다.

** 참고로 \\172.16.25.126을 접근했을 때 파일이 아닌 브라우져 상에 보여지고 싶다면
/etc/samba/smb.conf 파일에 공유 옵션에 (7단계 참고) browseable 를 yes로 함.

더 자세한 정보는 www.samba.org 를 통해 확인 가능함.



반응형

'OS > Centos' 카테고리의 다른 글

Centos 7 서버 설정 하기  (0) 2019.04.17
VirtualBox 에서 Centos 7 초기 설치 후 설정하기  (0) 2019.03.07
Centos 6.3 에서 VNC 설치 하기  (0) 2013.01.21
CENTOS 5 버전의 SSH 관련 버그 오류  (0) 2010.10.05
TAR 절대 경로  (0) 2009.07.03
반응형

우선 업무특성상 인터넷 망 영역에서 WAS 시스템이 있어야 한다는 조건이 발생했다....

보안땜시 그렇다고 하는데....

후우...

* 기타 파일들
  - admin 설치용
  - jdk 1.4 호환용

  - 개발자 설치용
  - 전체 document
    - 윈도우 설치용


1. 아래의 사이트에서 톰켓 SRC 버젼을 받는다.
    - 사실 jsp 를 통한 서블릿 과정을 진행할려고 하여 별도의 apache 연동은 없다 ! (웹 서버가 필요하면 별도의 아파치 연동과정을 찾아볼것!)
    - 단순한 한개의 jsp 페이지의 값을 넘겨 주기만 할것임 !
    - 다운로드 주소 : http://tomcat.apache.org/download-55.cgi#5.5.31
- Core부분의 tar.gz을 클릭

2. 클릭하면 저장을 할 수 있다.


3. 설치할 AIX 시스템에 FTP로 전송한다.
    - 계정 root
    - 경로 /usr/local/

4. root 계정으로 쉘 접속을 한다.
    - 아래의 명령을 실행한다.
 # cd /usr/local/
 # gzip -d apache-tomcat-5.5.31.tar.gz
 # tar xvf apache-tomcat-5.5.31.tar
 # ln -s /usr/local/apache-tomcat-5.5.31 /usr/local/tomcat
 # useradd -d /home/tomcat -g staff tomcat
 # passwd tomcat
 # mkdir /home/tomcat
 # chown -R tomcat:staff /usr/local/apache-tomcat-5.5.31 /usr/local/tomcat
 # chown -R tomcat:staff /home/tomcat

5. tomcat 계정으로 접속 후 .profile 파일을 변경처리 한다.

 if [ -s "$MAIL" ]                  # This is at Shell startup.  In normal
        then echo "$MAILMSG"       # operation, the Shell checks
fi                                 # periodically.


export JAVA_HOME=/usr/java5_64

set -o vi

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:${JAVA_HOME}/jre/bin:${JAVA_HOME}/bin:/usr/local/bin:/usr/local/tomcat/bin:.

stty erase ^?

export LANG=ko_KR

export PS1=[`hostname`:\$PWD]

umask 022


######### Tomcat 환경 변수 등록 #############

export CATALINA_HOME=/usr/local/tomcat


6. 다시 tomcat 계정으로 접속한다.
$> startup.sh 실행 후 (기동 명령)
$> ps -ef | grep startup.sh 조회시 프로세서가 조회되면 정상작동
$> shutdown.sh 실행 후 (종료 명령)
$> ps -ef | grep startup.sh 조회시 프로세서가 조회되지 않아야 정상 종료

위의 startup.sh 실행후 http://서버IP:8080/ 조회하면 노란 고양이를 만날수 있다.

포트 변경은 /usr/local/tomcat/conf/server.xml 파일내의 8080 포트를 검색하여 수정하면 된다(다른 포트와 충돌시 가동하지 않음)

※ 만약 기본 webapps 폴더이외의 홈 경로를 변경하고 싶다면...

/usr/local/tomcat/conf/Catalina/localhost/ROOT.xml 파일 생성

아래의 docBase 내용의 /home/myweb 디렉토리가 홈 디렉토리로 설정된다.

ROOT.xml 파일 내용
 <?xml version="1.0" encoding="UTF-8"?>
<Context path="" docBase="/home/myweb" debug="0" privileged="true" reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs"  prefix="localhost_log." suffix=".txt" timestamp="true"/>
</Context>



** 보안 취약 사항 수정 방법
telnet 호스트주소 8080
OPTIONS * HTTP/1.0

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Allow: GET, HEAD, POST, PUT, DELETE, OPTIONS
Content-Length: 0
Date: Thu, 23 Jun 2011 08:25:16 GMT
Connection: close

위의 PUT과 DELETE의 불필요한 메소드가 활성화 되어 위험함

제거 방법

/usr/local/tomcat/conf/web.xml 파일 제일 하단부에 붉은 색 표기와 같은 형태로 입력하면 됨

     <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>


 <security-constraint>
 <web-resource-collection>
  <web-resource-name>Protected Context</web-resource-name>
  <url-pattern>/*</url-pattern>
    <http-method>HEAD</http-method>
    <http-method>TRACE</http-method>
    <http-method>OPTIONS</http-method>
 </web-resource-collection>
 <auth-constraint />
 </security-constraint>

   <security-constraint>
     <web-resource-collection>
        <web-resource-name>Protected Context</web-resource-name>
         <url-pattern>/servlet/org.apache.catalina.servlets.DefaultServlet/*</url-pattern>
      </web-resource-collection>
      <!-- auth-constraint goes here if you requre authentication -->
      <user-data-constraint>
         <transport-guarantee>CONFIDENTIAL</transport-guarantee>
      </user-data-constraint>
   </security-constraint>

</web-app>

 




조치 결과
telnet 호스트주소 8080
OPTIONS * HTTP/1.0

HTTP/1.1 403 Forbidden
Server: Apache-Coyote/1.1
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 09:00:00 KST
Content-Type: text/html;charset=utf-8
Content-Length: 1108
Date: Thu, 23 Jun 2011 11:07:09 GMT
Connection: close

<html><head><title>Apache Tomcat/5.5.31 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 403 - Access to the requested resource has been denied</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Access to the requested resource has been denied</u></p><p><b>description</b> <u>Access to the specified resource (Access to the requested resource has been denied) has been forbidden.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.31</h3></body></html>Connection closed by foreign host.


반응형

'OS > AIX' 카테고리의 다른 글

bff 파일 설치 (AIX)  (0) 2010.12.08
IBM AIX 용 JAVA 다운로드 주소  (0) 2010.12.07
AIX 시스템 점검 쉘  (0) 2010.06.04
Xmanager on AIX 5.3  (1) 2010.02.09
How to install/start/restart the X11 server under AIX  (0) 2010.02.05

+ Recent posts