Solved: How to check remote port status in windows server 2016 without telnet
Telnet was always a security risk as data transfer is not secure on it. Seems like Microsoft has now finally removed it from Windows Server 2016.
We generally use telnet to check if a port is open on the remote server. So, how to check it now without telnet?
Instead of telnet you can use powershell commands to check the connections.
Please follow below steps for details.
Search for Windows powershell and open its console in your Windows 2016 server.
Use “Test-NetConnection ” command to check the port status. Let’s check if ports 3389 is open.
Test-NetConnection 10.0.1.15 -port 3389
If port is open you will get output like below.
ComputerName : 10.0.1.15
RemoteAddress : 10.0.1.15
RemotePort: 3389
InterfaceAlias : Ethernet 3
SourceAddress : 10.0.1.37
TcpTestSucceeded : True
Else, you will get failed message. In the below example we can see that the ping reply succeeded as ICMP is allowed, but “TcpTestSucceeded” is false as remote port 3389 is not open.
WARNING: TCP connect to 20.0.1.18:3389 failed
ComputerName : 20.0.1.18
RemoteAddress : 20.0.1.18
RemotePort : 3389
InterfaceAlias : Ethernet 3
SourceAddress : 10.0.1.37
PingSucceeded : True
PingReplyDetails (RTT) : 147 ms
TcpTestSucceeded : False
Tip:- Read this post for checking port in Linux without telnet .
AWS CLI Elastic Beanstalk cheat sheet
In our last post we have seen how to use EB CLI for managing elastic beanstalk through command line. But, you can also manage elastic beanstalk using traditional AWS CLI. In this post you will find AWS CLI cheat sheet for the same.
If you are new to Elastic Beanstalk, it’s recommended that you go through this free AWS Elastic Beanstalk crash course.
Below are the major commands used frequently while managing the elastic beanstalk environment.
To check the availability of a CNAME
The following command creates a new environment for version “v1” of a java application named “CldVdsApp”:
The following create-environment command specifies that a JSON file with the name myoptions.jsonshould be used to override values obtained from the solution stack or the configuration template:
To create a storage location
The following command creates a storage location in Amazon S3:
To abort a deployment
The following command deletes an application named CldVdsApp:
You can refer the complete set of AWS CLI for elastic beanstalk on this link.
Note:- All the above commands are taken from different AWS CLI reference guides and put in one place over here. Please run the commands after due diligence as we won’t be responsible for any mistakes in executing the commands and it’s consequences. If you have any concern or query feel free to contact us or comment below.
If you are new to Elastic Beanstalk, it’s recommended that you go through this free AWS Elastic Beanstalk crash course.
Below are the major commands used frequently while managing the elastic beanstalk environment.
To check the availability of a CNAME
aws elasticbeanstalk check-dns-availability --cname-prefix my-cnameTo create a new application
aws elasticbeanstalk create-application --application-name CldVdsApp --description "my application"Compose Environments
aws elasticbeanstalk compose-environments --application-name media-library --group-name dev --version-labels front-v1 worker-v1To create a new environment for an application
The following command creates a new environment for version “v1” of a java application named “CldVdsApp”:
aws elasticbeanstalk create-environment --application-name CldVdsApp --environment-name my-env --cname-prefix CldVdsApp --version-label v1 --solution-stack-name "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8"To specify a JSON file to define environment configuration options
The following create-environment command specifies that a JSON file with the name myoptions.jsonshould be used to override values obtained from the solution stack or the configuration template:
aws elasticbeanstalk create-environment --environment-name sample-env --application-name CldVdsApp --option-settings file://myoptions.json
The following command creates a storage location in Amazon S3:
aws elasticbeanstalk create-storage-location
aws elasticbeanstalk abort-environment-update --environment-name my-envTo delete an application
The following command deletes an application named CldVdsApp:
aws elasticbeanstalk delete-application --application-name CldVdsApp
Note:- All the above commands are taken from different AWS CLI reference guides and put in one place over here. Please run the commands after due diligence as we won’t be responsible for any mistakes in executing the commands and it’s consequences. If you have any concern or query feel free to contact us or comment below.
Solved: Exceeded EC2 Instance Quota
You may face an error like “Exceeded EC2 Instance Quota” while you are trying to spin up new instances either standalone or in cluster.
This error is caused because you have hit the limit on number of instances allowed in your AWS account.
This limit is region and instance size specific. To get rid of this error you will have to request Amazon to increase the EC2 instance limit.
Requesting a limit increase is simple. Please follow below steps to know more.
This error is caused because you have hit the limit on number of instances allowed in your AWS account.
This limit is region and instance size specific. To get rid of this error you will have to request Amazon to increase the EC2 instance limit.
Requesting a limit increase is simple. Please follow below steps to know more.
- Login to you AWS console and select EC2 from Services drop down.
- Once in EC2 dashboard, in the left menu look for “Limits” and click on it.(refer image below)
- Expand “Instance Limits” to see the limits in your account for each instance type. In our case we have limit of 5 on “r4.2xlarge instances” so we click on “Request limit Increase”.
- You will get option to Create Case. Fill the details as in below image with a reason for requesting limit increase.
- Once you submit the case, if your reason is good enough for Amazon they will increase the limit between couple of minutes to few hours.
AWS EB CLI Cheat Sheet - Elastic Beanstalk
In this post we will discuss about the Elastic Beanstalk CLI called EB CLI.
If you are new to Elastic Beanstalk, it’s recommended that you go through this free AWS Elastic Beanstalk crash course.
If you want to manage Elastic Beanstalk using traditional AWS CLI follow this post .
Installation
Follow these guides to install eb cli on Windows, Linux and MacOS .
Get help
Above list is created by referring the AWS doc for elastic beanstalk cli . If you have any query or concern please feel free to contact us.
If you are new to Elastic Beanstalk, it’s recommended that you go through this free AWS Elastic Beanstalk crash course.
If you want to manage Elastic Beanstalk using traditional AWS CLI follow this post .
Installation
Follow these guides to install eb cli on Windows, Linux and MacOS .
Get help
eb -hInitialize eb cli
eb initIt will ask questions:-
- Default region
- Access key details
- Select existing application or create new.
- Application name
- Platform e.g. PHP, Python etc.
- Setup ssh
- Select keypair or create one.
eb createCheck status
eb statusCheck health information
eb healthCheck events
eb eventsPull logs
eb logsOpen environment website in browser
eb openDeploy Update
eb deployCheck configuration options
eb configTerminate environment
eb terminateList environments
eb listChange current environment
eb use cldvds-env
Below are some other useful commands
eb abort | Cancel deployment |
eb appversion | Manage EB application versions |
eb clone | Create clone of environment |
eb console | Open environment in AWS console |
eb labs | Extra commands for experiment |
eb local | Run commands on local machine |
eb platform | Manage platform |
eb printenv | Show environment variables |
eb restore | rebuild a terminated environment |
eb scale | Scaling the number of instances. |
eb setenv | Set environment variables |
eb ssh | Connect to instance via ssh |
eb swap | Swap CNAME of two environments |
eb tags | Modify environment tags |
eb upgrade | Update the platform to most recent version |
AWS EC2 CLI - Cheat sheet
Below is the cheat sheet of AWS CLI commands for EC2.
If you are new to EC2, it’s recommended that you go through this free AWS EC2 crash course.
If you want to know how to install AWS CLI please follow steps on this post
Get help
If you are new to EC2, it’s recommended that you go through this free AWS EC2 crash course.
If you want to know how to install AWS CLI please follow steps on this post
Get help
aws ec2 helpCreate instance EC2 Classic
aws ec2 run-instances --image-id ami-xxxxxxxx --count 1 --instance-type t1.micro --key-name MyKeyPair --security-groups my-sgCreate instance in VPC
aws ec2 run-instances --image-id ami-xxxxxxxx --count 1 --instance-type t2.micro --key-name MyKeyPair --security-group-ids \
sg-xxxxxxxx --subnet-id subnet-xxxxxxxxStart instance
aws ec2 start-instances --instance-ids <instance-id>Stop instance
aws ec2 stop-instances --instance-ids <instance-id>Reboot instance
aws ec2 reboot-instances --instance-ids <instance-id>Terminate instance
aws ec2 terminate-instances --instance-ids <instance-id>View console output
aws ec2 get-console-output --instance-id <instance-id>Describe Instance
aws ec2 describe-instances --instance-ids <instance-id>Create an AMI
aws ec2 create-image \ --instance-id <instance-id> \ --name myAMI \ --description 'CloudVedas Test AMI'List images(AMIs)
aws ec2 describe-images --image-ids <ami-id>List security groups
aws ec2 describe-security-groupsCreate security group
aws ec2 create-security-group --vpc-id vpc-1234abcd --group-name db-access --description "cloudvedas db access"Get details of security group
aws ec2 describe-security-groups --group-names <group-name>Delete Security group
aws ec2 delete-security-group --group-id sg-1234abcdList key pairs
aws ec2 describe-key-pairsCreate keypair
aws ec2 create-key-pair --key-name <value>Import keypair
aws ec2 import-key-pair --key-name keyname_test --public-key-material file:///cldvds/sagu/id_rsa.pubDelete keypair
aws ec2 delete-key-pair --key-name <value>Check the networking attribute
aws ec2 describe-instance-attribute --instance-id <instance-id> --attribute sriovNetSupportAdd tags to instance
aws ec2 create-tags --resources i-xxxxxxxx --tags Key=Name,Value=MyInstanceAdd EBS volume
aws ec2 --block-device-mappings "[{\"DeviceName\":\"/dev/sdf\",\"Ebs\":{\"VolumeSize\":20,\"DeleteOnTermination\":false}}]"List EBS volumes
aws ec2 describe-volumesCheck snapshot associated with EBS volume
aws ec2 describe-volumes --volume-ids vol-01c6l3de3v21bd46sNote:- All the above commands are taken from different AWS EC2 CLI reference guides and put in one place over here. Please run the commands after due diligence as we won’t be responsible for any mistakes in executing the commands and it’s consequences. If you have any concern or query feel free to contact us.
AWS S3 CLI - Cheat sheet
Below is the cheat sheet of AWS CLI commands for S3.
If you are new to S3 it’s recommended that you go through this free AWS S3 crash course.
If you want to know how to install AWS CLI, follow steps on this post.
Get help
Sync buckets
List buckets
The following example copies an object into a bucket. It grants read permissions on the object to everyone and full permissions (read, readacl, and writeacl) to the account associated with user@example.com.
If you are new to S3 it’s recommended that you go through this free AWS S3 crash course.
If you want to know how to install AWS CLI, follow steps on this post.
Get help
aws s3 helpor
aws s3api helpCreate bucket
aws s3 mb s3://bucket-nameRemoving bucket
aws s3 rb s3://bucket-nameTo remove a non-empty bucket (Extremely careful while running this). This will remove all contents in the bucket including subfolders and data in them.
aws s3 rb s3://bucket-name --forceCopy object
aws s3 cp mypic.png s3://mybucket/Copy buckets
aws s3 cp myfolder s3://mybucket/myfolder --recursive(Note: –recursive will copy recursively everything including the subfolders)
Sync buckets
aws s3 sync <source> <target> [--options]
List buckets
aws s3 lsList specific bucket
aws s3 ls s3://mybucketBucket location
aws s3api get-bucket-location --bucket <bucket-name>Logging status
aws s3api get-bucket-logging --bucket <bucket-name>
ACL (Access Control List)The following example copies an object into a bucket. It grants read permissions on the object to everyone and full permissions (read, readacl, and writeacl) to the account associated with user@example.com.
aws s3 cp file.txt s3://my-bucket/ --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=emailaddress=user@example.com
Subscribe to:
Posts (Atom)