원문 : 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 rx2660서버에서 H/W RAID 구성하기 ischo 2019.10.04 2301
» 특정계정만 ssh 접속 불가 sftp 만 접속 가능한 환경 만들기 ischo 2019.05.09 2241
48 HP-UX 환경에서 접근제어 사용하기 조인상 2016.06.02 14634
47 HP rp시리즈에서 mirror(lv-copy) 된 디스크 교체 : replace disk in mirror vg [1] 조인상 2016.05.18 21952
46 bdf의 결과를 GB단위로 보여주는 스크립트 [1] 조인상 2015.10.27 9994
45 Vmware ESXI 환경에서 HP Smart Array CLI 사용하기 - command 예제 조인상 2015.07.29 9158
44 VG00 의 mirror 상태 점검 스크립트 조인상 2015.06.12 5771
43 HP-UX에 JDK 1.5 설치 file 조인상 2013.10.15 20027
42 HP-UX Web Server Suite Installation guide file 조인상 2013.09.11 12541
41 Event Monitoring Service - Event Log path 조인상 2013.07.03 12130
40 HP-UX에 gcc 설치 조인상 2013.04.11 19380
39 장비 H/W미러링 장치 확인 및 미러상태 점검 [1] 조인상 2013.02.25 26455
38 해당 포트를 열고 있는 프로세스 확인방법. netstat, lsof 조인상 2012.09.20 33435
37 시리얼 케이블 제작방법 조인상 2012.06.27 12865
36 HP Integrated Lights-Out User Guide [1] file 조인상 2012.03.14 13355
35 HP iLO 설정 및 라이센스 발급 방법 조인상 2012.03.14 16179
34 <queue max run limit reached / 대기행렬의 최대 실행 한계에 도달했습니다> 에러 발생시. 조인상 2012.02.29 16512
33 HP DAT Drive Manual file 조인상 2012.01.03 14186
32 DAT tape drive 인식 작업 조인상 2011.12.28 24503
31 HP0-P20 CSA-HPUX 11i v3 : HP-UX System Administrator’s Guide: Configuration Management file 조인상 2011.11.25 20717
서버에 요청 중입니다. 잠시만 기다려 주십시오...