|
| 1 | +--- |
| 2 | +title: "lacework agent aws-install ec2ssh" |
| 3 | +slug: lacework_agent_aws-install_ec2ssh |
| 4 | +hide_title: true |
| 5 | +--- |
| 6 | + |
| 7 | +## lacework agent aws-install ec2ssh |
| 8 | + |
| 9 | +Use SSH to securely connect to EC2 instances |
| 10 | + |
| 11 | +### Synopsis |
| 12 | + |
| 13 | +This command installs the agent on all EC2 instances in an AWS account |
| 14 | +using SSH. |
| 15 | + |
| 16 | +To filter by one or more regions: |
| 17 | + |
| 18 | + lacework agent aws-install ec2ssh --include_regions us-west-2,us-east-2 |
| 19 | + |
| 20 | +To filter by instance tag: |
| 21 | + |
| 22 | + lacework agent aws-install ec2ssh --tag TagName,TagValue |
| 23 | + |
| 24 | +To filter by instance tag key: |
| 25 | + |
| 26 | + lacework agent aws-install ec2ssh --tag_key TagName |
| 27 | + |
| 28 | +To provide an existing access token, use the '--token' flag. This flag is required |
| 29 | +when running non-interactively ('--noninteractive' flag). The interactive command |
| 30 | +'lacework agent token list' can be used to query existing tokens. |
| 31 | + |
| 32 | + lacework agent aws-install ec2ic --token <token> |
| 33 | + |
| 34 | +You will need to provide an SSH authentication method. This authentication method |
| 35 | +should work for all instances that your tag or region filters select. Instances must |
| 36 | +be routable from your local host. |
| 37 | + |
| 38 | +To authenticate using username and password: |
| 39 | + |
| 40 | + lacework agent aws-install ec2ssh --ssh_username <your-user> --ssh_password <secret> |
| 41 | + |
| 42 | +To authenticate using an identity file: |
| 43 | + |
| 44 | + lacework agent aws-install ec2ssh -i /path/to/your/key |
| 45 | + |
| 46 | +The environment should contain AWS credentials in the following variables: |
| 47 | +- AWS_ACCESS_KEY_ID |
| 48 | +- AWS_SECRET_ACCESS_KEY |
| 49 | +- AWS_SESSION_TOKEN (optional), |
| 50 | +- AWS_REGION (optional) |
| 51 | + |
| 52 | +This command will automatically add hosts with successful connections to |
| 53 | +'~/.ssh/known_hosts' unless specified with '--trust_host_key=false'. |
| 54 | + |
| 55 | +``` |
| 56 | +lacework agent aws-install ec2ssh [flags] |
| 57 | +``` |
| 58 | + |
| 59 | +### Options |
| 60 | + |
| 61 | +``` |
| 62 | + -h, --help help for ec2ssh |
| 63 | + -i, --identity_file string identity (private key) for public key authentication (default "~/.ssh/id_rsa") |
| 64 | + -r, --include_regions strings list of regions to filter on |
| 65 | + -n, --max_parallelism int maximum number of workers executing AWS API calls, set if rate limits are lower or higher than normal (default 50) |
| 66 | + --ssh_password string password for authentication |
| 67 | + --ssh_port int port to connect to on the remote host (default 22) |
| 68 | + --ssh_username string username to login with |
| 69 | + --tag strings only select instances with this tag |
| 70 | + --tag_key string only install agents on infra with this tag key |
| 71 | + --token string agent access token |
| 72 | + --trust_host_key automatically add host keys to the ~/.ssh/known_hosts file (default true) |
| 73 | +``` |
| 74 | + |
| 75 | +### Options inherited from parent commands |
| 76 | + |
| 77 | +``` |
| 78 | + -a, --account string account subdomain of URL (i.e. <ACCOUNT>.lacework.net) |
| 79 | + -k, --api_key string access key id |
| 80 | + -s, --api_secret string secret access key |
| 81 | + --api_token string access token (replaces the use of api_key and api_secret) |
| 82 | + --debug turn on debug logging |
| 83 | + --json switch commands output from human-readable to json format |
| 84 | + --nocache turn off caching |
| 85 | + --nocolor turn off colors |
| 86 | + --noninteractive turn off interactive mode (disable spinners, prompts, etc.) |
| 87 | + --organization access organization level data sets (org admins only) |
| 88 | + -p, --profile string switch between profiles configured at ~/.lacework.toml |
| 89 | + --subaccount string sub-account name inside your organization (org admins only) |
| 90 | +``` |
| 91 | + |
| 92 | +### SEE ALSO |
| 93 | + |
| 94 | +* [lacework agent aws-install](lacework_agent_aws-install.md) - Install the datacollector agent on all remote AWS hosts |
| 95 | + |
0 commit comments