Azure VM 생성하는 Azure CLI


참고: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/tutorial-manage-vm

1) Resource Group 생성하기
az group create –name myRG –location eastus
az group list -o table

2) VM 생성하기-기본
az vm create –resource-group myRG –name myVM1 –image UbuntuLTS –generate-ssh-keys

3) VM에 연결하기
ssh 52.174.34.95
exit

4) 사용가능한 VM 이미지 목록 확인하기
az vm image list –output table

5) 사용 가능한 모든 VM 이미지 확인하기
az vm image list –offer CentOS –all –output table
az vm image list –offer Ubuntu –all –o table

6) VM 생성하기-상세
az vm create –resource-group myRG –name myVM2 –image OpenLogic:CentOS:6.5:latest –generate-ssh-keys

7) 사용 가능한 VM 크기 확인하기
az vm list-sizes –location eastus –output table

8) 특정한 VM 크기의 VM 생성하기
az vm create –resource-group myRG –name myVM3 –image UbuntuLTS –size Standard_F4s –generate-ssh-keys

9) 현재 실행중인 VM 크기 확인하기
az vm show –resource-group myRG –name myVM1 –query hardwareProfile.vmSize

10) 변경 가능한 VM 크기 확인하기
az vm list-vm-resize-options –resource-group myRG –name myVM1 –query [].name

11) VM 크기 변경하기
az vm resize –resource-group myRG –name myVM1 –size Standard_DS4_v2

12) VM의 Power State 확인하기
az vm get-instance-view –name myVM1 –resource-group myRG –query instanceView.statuses[1] –output table

13) VM의 IP Address 확인하기
az vm list-ip-addresses –resource-group myRG –name myVM1 –output table

14) VM 멈추고 시작하기
az vm stop –resource-group myRG –name myVM1
az vm start –resource-group myRG –name myVM1

15) Resource Group 삭제하기
az group delete –name myRG –no-wait –yes

 

sysctl을 사용하여 CentOS7 Kernel을 보안설정 및 서버 하드닝하기


참고: https://www.vultr.com/docs/securing-and-hardening-the-centos-7-kernel-with-sysctl

CentOS7에서 sysctl을 사용하여 CentOS7 Kernel을 보안설정하기

<영구적으로 ping에 응답하지 않게 하기>
vi /etc/sysctl.conf
net.ipv4.icmp_echo_ignore_all=1
시스템 재부팅

<임시적으로 ping에 응답하지 않게 하기>
sysctl -w net.ipv4.icmp_echo_ignore_all=1

자세한 내용은 위의 링크를 참고한다