알리 클라우드에서 동적 IP를 보안 그룹에 추가
https://github.com/aliyun/aliyun-cli/releases
wget https://github.com/aliyun/aliyun-cli/releases/download/v3.0.73/aliyun-cli-linux-3.0.73-amd64.tgz
tar zxvf aliyun-cli-linux-3.0.73-amd64.tgz
sudo cp aliyun /usr/local/bin
Aliyun 관리 인터페이스를 구성하고 accesskey API 호출을 추가하여 ECS 관리자 권한을 추가합니다.
aliyun configure --mode AK --profile akProfile
Configuring profile 'akProfile' in 'AK' authenticate mode...
Access Key Id []: xxxxxx # keyID
Access Key Secret []: xxxxx # ID
Default Region Id []: cn-beijing
Default Output Format [json]: json (Only support json)
Default Language [zh|en] en: zh
Saving profile[akProfile] ...Done.
Configure Done!!!
..............888888888888888888888 ........=8888888888888888888D=..............
...........88888888888888888888888 ..........D8888888888888888888888I...........
.........,8888888888888ZI: ...........................=Z88D8888888888D..........
.........+88888888 ..........................................88888888D..........
.........+88888888 .......Welcome to use Alibaba Cloud.......O8888888D..........
.........+88888888 ............. ************* ..............O8888888D..........
.........+88888888 .... Command Line Interface(Reloaded) ....O8888888D..........
.........+88888888...........................................88888888D..........
..........D888888888888DO+. ..........................?ND888888888888D..........
...........O8888888888888888888888...........D8888888888888888888888=...........
............ .:D8888888888888888888.........78888888888888888888O ..............
스크립트 추가
new_ip=`curl -L ip.tool.lu | head -1 |awk -F ": " '{print $2}'|sed 's/\r//g'`
####
# --SecurityGroupId ID
# --Description
# --IpProtocol= tcp、udp、icmp、gre、all:
# --PortRange=22/22
# --SourceCidIp= IPv4 CIDR 。 CIDR IPv4 IP
# --Priority 1
aliyun ecs AuthorizeSecurityGroup --SecurityGroupId=sg-2zee***** --Description=" IP " --IpProtocol=tcp --PortRange=22/22 --SourceCidrIp=$new_ip
계획 임무를 추가하여 실제 상황에 따라 조정하다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
아리운 SSH "Write failed: Broken pipe"문제 해결 방법문제 장면 서버 환경: Ali운 Linux CentOS 호스트 클라이언트: Mac OSX Terminal 문제 현상 ssh 명령으로 서버에 연결한 후 일정 시간 동안 조작하지 않으면 다시 Terminal에 들어갈 때...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.