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

본문 바로가기

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

페이지 정보

작성자 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 에필로그 댓글 0건 조회 4,056회 작성일 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건/6페이지
에필로그 목록
번호 제목 글쓴이 조회 날짜
265 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3040 10-07
264 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2807 10-07
263 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2867 10-07
262 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3396 10-07
261 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3311 10-07
260 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3469 10-07
259 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3242 10-07
258 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3239 10-07
257 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3553 10-07
256 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3736 10-07
255 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3890 10-07
254 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3385 10-09
열람중 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4057 12-03
252 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3318 12-03
251 no_profile 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3716 12-03
게시물 검색
[문의] 전화 : 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.