원문 : http://www.ischo.net -- 조인상 // 시스템 엔지니어

Writer : http://www.ischo.net -- ischo // System Engineer in Replubic Of Korea

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

원문 : http://www.ischo.net -- 조인상 //시스템 엔지니어

+++++++++++++++++++++++++++++++++++++++++++++++++++++++



참고 : https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c01516983



목표 : HP-UX 환경에서 sftpuser 계정으로 ssh 접속은 불허용, sftp접속만 가능하도록 구성



1. 디렉토리 생성

# mkdir -m 755 /sftpdir


2. 계정생성

# useradd -d /sftpdir/home/sftpuser -s /bin/sh sftpuser


3. /opt/ssh/utils/ssh_chroot_setup.sh 실행

# /opt/ssh/utils/ssh_chroot_setup.sh

         HP SECURE SHELL: CHROOT ENVIRONMENT SETUP - MAIN MENU
         -----------------------------------------------------

         Select one of the option below

         1.Configure a new user

         2.Configure an existing user to a chroot-ed user

         3.Remove chroot environment from a chroot-ed user

         4.Exit


         Enter your choice : 2

         Chroot setup
        ---------------

         User name (Maximum eight chars) : sftpuser

         chroot setup checks for user details ...completed


         Enter the new root directory for sftptest with absolute path (or press return for default(/newroot)): /sftpdir


         ---------------------------------
         Select chroot secure shell option
         ----------------------------------
         1 sftp
         2 ssh & sftp & scp
         press return key to skip this step


         Option : 1

         chroot setup for sftp operations

         IMPORTANT NOTE:
         This setup will make sure that sftp works in your chroot environment
         It should not be interpreted as a restrictive sftp-only Shell.
         This setup simply copies the files required for sftp to the appropriate directories under the newroot.


         Now configuring the chroot environment for sftp ...finished

         Summary
         --------

         Chroot-ed user : sftpuser

         Chroot-ed user's new root directory : /sftpdir/home/sftpuser

         Secure Shell configuration : SFTP

         press Return key


         HP SECURE SHELL: CHROOT ENVIRONMENT SETUP - MAIN MENU
         -----------------------------------------------------

         Select one of the option below

         1.Configure a new user

         2.Configure an existing user to a chroot-ed user

         3.Remove chroot environment from a chroot-ed user

         4.Exit


         Enter your choice : 4



4. chroot 된 디렉토리 환경설정

# chmod 777 /sftpdir/tmp

# chown sftpuser /sftpdir/home/sftpuser

# cp -p /var/adm/wtmp /sftpdir/var/adm



5. chroot된 디렉토리내 sh 삭제

# rm /sftpdir/bin/sh



6. ssh 접속테스트


7. sftp 접속 및 업로드, 파일 삭제 테스트








번호 제목 글쓴이 날짜 조회 수
50 HP-UX 장비 GSP/MP접속 및 기본 사용법 [2] 조인상 2011.02.25 56389
49 HP-UX 기본 점검 명령어 조인상 2011.02.22 41985
48 disk 추가에서 볼륨생성까지 조인상 2011.02.18 40261
47 HP-UX 네트웍 관리 조인상 2011.03.08 36268
46 swinstall 로 depot 설치하기 file 조인상 2011.03.29 36064
45 해당 포트를 열고 있는 프로세스 확인방법. netstat, lsof 조인상 2012.09.20 33435
44 NTP 서버/클라이언트 설정 조인상 2011.03.01 29611
43 ignite를 이용한 OS백업 조인상 2011.07.21 28535
42 HP-UX Kernel Tuning and Performance Guide - 2000.3.15 조인상 2011.08.30 27193
41 장비 H/W미러링 장치 확인 및 미러상태 점검 [1] 조인상 2013.02.25 26455
40 H/W RAID 정보 확인하기 조인상 2011.02.25 25045
39 nPAR, vPAR 의 개념 [9] 조인상 2011.10.28 24978
38 HP-UX LVM 조인상 2011.02.18 24923
37 DAT tape drive 인식 작업 조인상 2011.12.28 24503
36 HP rp시리즈에서 mirror(lv-copy) 된 디스크 교체 : replace disk in mirror vg [1] 조인상 2016.05.18 21952
35 sasmgr 명령어 사용시 Driver specific and common library version mismatch. Exiting.. file 조인상 2011.03.16 21667
34 HP0-P20 CSA-HPUX 11i v3 : HP-UX System Administrator’s Guide: Configuration Management file 조인상 2011.11.25 20717
33 HP-UX Administration I - Part 2 (Module 11~20) 조인상 2011.09.08 20456
32 HP-UX에 JDK 1.5 설치 file 조인상 2013.10.15 20027
31 HP-UX에 gcc 설치 조인상 2013.04.11 19380
서버에 요청 중입니다. 잠시만 기다려 주십시오...