원문 : 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 접속 및 업로드, 파일 삭제 테스트








번호 제목 글쓴이 날짜 조회 수
» 특정계정만 ssh 접속 불가 sftp 만 접속 가능한 환경 만들기 ischo 2019.05.09 2278
49 HP rx2660서버에서 H/W RAID 구성하기 ischo 2019.10.04 2336
48 VG00 의 mirror 상태 점검 스크립트 조인상 2015.06.12 5787
47 파트너 관련 각 시험 코드표 조인상 2011.06.15 8685
46 Vmware ESXI 환경에서 HP Smart Array CLI 사용하기 - command 예제 조인상 2015.07.29 9197
45 bdf의 결과를 GB단위로 보여주는 스크립트 [1] 조인상 2015.10.27 10043
44 HP-UX 11i v3 소개 및 release note + Road Map file 조인상 2011.10.28 10574
43 HP-UX 11.11 에서 cpu/mem/Kernel info 긁어오는 스크립트 조인상 2011.06.24 10762
42 Dynamic Root Disk A.3.9.* Administrator's Guide file 조인상 2011.10.28 11076
41 HP-UX 11i v3 - Native Multi-Pathing for Mass Storage file 조인상 2011.10.28 11096
40 HP BladeSystem Onboard Administrator User Guide file 조인상 2011.09.06 12128
39 Event Monitoring Service - Event Log path 조인상 2013.07.03 12145
38 Storage & Ethernet Adapter Support Matrix file 조인상 2011.11.23 12194
37 HP-UX Web Server Suite Installation guide file 조인상 2013.09.11 12566
36 시리얼 케이블 제작방법 조인상 2012.06.27 12885
35 HP-UX CSA~CSE 인증시험 커리큘럼 + HP0-P20 준비 가이드 file 조인상 2011.10.28 13087
34 HP Integrated Lights-Out User Guide [1] file 조인상 2012.03.14 13374
33 HP Superdome 2 Partitioning Administrator Guide for HP-UX 11i v3 file 조인상 2011.10.28 13710
32 HP-UX 11i v3 Installation and Update Guide file 조인상 2011.10.24 13824
31 HP DAT Drive Manual file 조인상 2012.01.03 14202
서버에 요청 중입니다. 잠시만 기다려 주십시오...