Skip to content
/ ec2scp Public
forked from EmilLaursen/ec2scp

Mostly wraps aws ec2-instance-connect send-ssh-public-key and a scp call. Enables easy scp'ing to EC2 intances, using aws IAM credentials and instance-ids.

Notifications You must be signed in to change notification settings

Hojland/ec2scp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS EC2 scp CLI

Wrapper around the EC2 instance connect CLI tools, mssh and msftp, which enables using instance names instead of instance ids. E.g. with an instance named 'api' with instance id 'i-jadksafkj4rk3desf' you can execute ec2 ssh api instead of mssh ubuntu@i-jadksafkj4rk3desf or mssh ec2-user@i-jadksafkj4rk3desf, and likewise for msftp.

Additional subcommands are available. For instance it is possible to use scp, by pushing your local rsa key to the instance for 60 seconds, using boto3, and then executing the scp command. Again it is possible to use instance names or instance ids, istead of the public DNS/ip of the instance, as is usually required by scp.

Use SCP to upload files to EC2 instances using aws IAM credentials instead of ssh keys. Upload sample: ec2 scp source_file INSTANCE-ID:dest_file Download sample: ec2 scp INSTANCE-NAME:source_file dest_file

Instances can be referenced by instance id or Name. Setup a configuration file and edit it, to give custom aliases to your instances.

You can use relative paths on the remote. Thus ec2 scp t.txt NAME:file.txt is equivalent to ec2 scp t.txt NAME:/home/ubuntu/file.txt if instance is running ubuntu.

Installation.

Clone repo and run make build in your favourite environment.

TODO:

  • [] fix issue with non unique names.
  • mssh also has msftp, making the scp subcommand somewhat obsolete. Rewrite whole app to be a wrapper around mssh and msftp calls enabling name aliases in a config, instead of just instance-ids.
  • Handle errors and exceptions!
  • Dry runs to check credentials.

About

Mostly wraps aws ec2-instance-connect send-ssh-public-key and a scp call. Enables easy scp'ing to EC2 intances, using aws IAM credentials and instance-ids.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 99.8%
  • Makefile 0.2%