SSH 접속시 명령어 제한(Ssh Forced Command) 예 > 에필로그

본문 바로가기

SSH 접속시 명령어 제한(Ssh Forced Command) 예

페이지 정보

작성자 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 에필로그 댓글 0건 조회 4,011회 작성일 18-12-03 17:07

본문

RedHat, CentOS, Fedora...

SSH 접속자가 사용할 명령어를 제한한다.

vi /etc/ssh/sshd_config
AuthorizedKeysFile %h/.ssh/id_rsa.pub #.ssh/authorized_keys 주석
PermitEmptyPasswords no
systemctl restart sshd.service
adduser xxxxxx
su xxxxxx
ssh-keygen -t rsa
exit
vi /home/xxxxxx/.ssh/id_rsa.pub
command="/etc/allowed-commands.sh" #ssh-rsa ~ 앞에 붙힘

vi /etc/allowed-command.sh #예

#!/bin/sh
/bin/echo "Welcome!
Your choices are:
1 : View server time
2 : View login time
q : Quit"
/bin/echo "Your choice:"
read ans
while [ "$ans" != "q" ]
do
 case "$ans" in
  1)
   /bin/date
   ;;
  2)
   /usr/bin/who am i
   ;;
  q)
   /bin/echo "Goodbye!"
   exit 0
   ;;
  *)
   /bin/echo "Invalid choice '$ans': Please try again"
   ;;
 esac
 /bin/echo "Your choice:"
 read ans
done
exit 0

 개인키 id_rsa를 다운로드 또는 복사, Putty에서는 ppk로 변환해서 사용

댓글목록

등록된 댓글이 없습니다.

에필로그 340건/21페이지
에필로그 목록
번호 제목 글쓴이 조회 날짜
40 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3272 02-17
39 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3428 01-03
38 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3263 01-03
37 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3335 10-09
36 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3423 10-07
35 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3263 10-07
34 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4125 02-06
33 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4030 08-11
32 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4483 05-29
31 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3851 05-25
30 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3827 03-14
29 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6131 12-27
열람중 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4012 12-03
27 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3502 10-07
26 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3332 09-05
게시물 검색
[문의] 전화 : 0707-443-0499 메일 : t8@t8.co.kr [분야] Linux, Unix, Windows DNS, 웹, WAS, 역방향프록시, 앱 SQL, 메일, 스트리밍, CDN SMB/CIFS, FTPs, NFS, AFP IKEv2, OpenVPN, WireGuard 대범위 DHCP, WiFi 종속포털, AAA DDoS 우회/분산, 랜섬웨어 대비 장애/재난/해킹시스템 복구 서비스/P2V 마이그레이션 XSS/웹쉘/인젝션/백도어 제거 서버 업그레이드/교체/이전 주문/맞춤/복합/간이서버 제작 특별/희귀/생소한 시스템 상담/구현 문제해결 외

Copyright © T8. All rights reserved.