# Auth Method - ssh private key

**URL:** <https://discuss.hashicorp.com/t/auth-method-ssh-private-key/16688>\
**Category:** Boundary\
**Created:** [October 26, 2020, 5:01pm UTC](https://discuss.hashicorp.com/t/auth-method-ssh-private-key/16688 "2020-10-26T17:01:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thiagodeandrade](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/thiagodeandrade/32/3916_2.png) [@thiagodeandrade](https://discuss.hashicorp.com/u/thiagodeandrade)\
**Post date:** [October 26, 2020, 5:01pm UTC](https://discuss.hashicorp.com/t/auth-method-ssh-private-key/16688/1 "2020-10-26T17:01:07Z")

</div>

How to connect to AWS ec2-instances with ssh keys?  
In auth methods I just put login name and password, but my connection use key pair

---

<div class="post-metadata">

**Author:** ![jeff](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jeff/32/12882_2.png) [@jeff](https://discuss.hashicorp.com/u/jeff)\
**Post date:** [October 27, 2020, 4:02am UTC](https://discuss.hashicorp.com/t/auth-method-ssh-private-key/16688/2 "2020-10-27T04:02:28Z")

</div>

Hi there,

Authenticating to Boundary is different from connecting to an SSH target – authenticating to Boundary is what allows you to authorize a connection to the target. Once you have authorized the connection and have a listening socket, you can authenticate via SSH as normal – you are simply pointing to the proxy address instead of the normal/public SSH address.

---

<div class="post-metadata">

**Author:** ![jessequinn](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jessequinn/32/12283_2.png) [@jessequinn](https://discuss.hashicorp.com/u/jessequinn)\
**Post date:** [October 28, 2020, 8:53am UTC](https://discuss.hashicorp.com/t/auth-method-ssh-private-key/16688/3 "2020-10-28T08:53:35Z")

</div>

Hi @thiagodeandrade

try `boundary connect ssh -username foo -target-it ttcp... -- -i <key_path>`
