# Remote access through SSH

**URL:** <https://discuss.elastic.co/t/remote-access-through-ssh/18991>\
**Category:** Elasticsearch\
**Created:** [July 30, 2014, 10:47pm UTC](https://discuss.elastic.co/t/remote-access-through-ssh/18991 "2014-07-30T22:47:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chia\_Eng\_Chang](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@Chia\_Eng\_Chang](https://discuss.elastic.co/u/Chia_Eng_Chang)\
**Post date:** [July 30, 2014, 10:47pm UTC](https://discuss.elastic.co/t/remote-access-through-ssh/18991/1 "2014-07-30T22:47:34Z")

</div>

About the HTTP API, I wonder if I want to remote access a cluster on SSH  
server, what should I include in my http rest command:

example as mapping:

```
curl -XGET ' http://localhost:9200/ index /_mapping/ type ' 

```

I tried something like below but got failed:

```
curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub 'xx.xxx.xxx.xxx:9200/index/_mapping/type'

```

Is there anyone knows the solution?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 30, 2014, 10:55pm UTC](https://discuss.elastic.co/t/remote-access-through-ssh/18991/2 "2014-07-30T22:55:29Z")

</div>

You need to use SSH directly for it, curl won't work.

ssh user@host -i ~/.ssh/id\_rsa.pub

Assuming you have a public key on the server.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 31 July 2014 08:47, Chia-Eng Chang [chiaengc@uci.edu](mailto:chiaengc@uci.edu) wrote:

> About the HTTP API, I wonder if I want to remote access a cluster on SSH  
> server, what should I include in my http rest command:
> 
> example as mapping:
> 
> ```
> curl -XGET ' http://localhost:9200/ index /_mapping/ type '
> 
> ```
> 
> I tried something like below but got failed:
> 
> ```
> curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub 'xx.xxx.xxx.xxx:9200/index/_mapping/type'
> 
> ```
> 
> Is there anyone knows the solution?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624YMcO4oP74SUAPwQFDpa8cZsVqNwMWGNg%3DcJGU2qkwQSw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624YMcO4oP74SUAPwQFDpa8cZsVqNwMWGNg%3DcJGU2qkwQSw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Chia\_Eng\_Chang](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@Chia\_Eng\_Chang](https://discuss.elastic.co/u/Chia_Eng_Chang)\
**Post date:** [July 30, 2014, 11:35pm UTC](https://discuss.elastic.co/t/remote-access-through-ssh/18991/3 "2014-07-30T23:35:34Z")

</div>

Thanks @Mark  
I have a public key on server and I know how to SSH to server then get the  
index from localhost:9200.  
But what I want to do is remotely obtain the index on the SSH server (which  
I know its public IP)

On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:

> You need to use SSH directly for it, curl won't work.
> 
> ssh user@host -i ~/.ssh/id\_rsa.pub
> 
> Assuming you have a public key on the server.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com) \<javascript:\>  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 31 July 2014 08:47, Chia-Eng Chang \<chia...@uci.edu \<javascript:\>\>  
> wrote:
> 
> > About the HTTP API, I wonder if I want to remote access a cluster on SSH  
> > server, what should I include in my http rest command:
> > 
> > example as mapping:
> > 
> > ```
> > curl -XGET ' http://localhost:9200/ index /_mapping/ type ' 
> > 
> > ```
> > 
> > I tried something like below but got failed:
> > 
> > ```
> > curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub 'xx.xxx.xxx.xxx:9200/index/_mapping/type'
> > 
> > ```
> > 
> > Is there anyone knows the solution?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 30, 2014, 11:46pm UTC](https://discuss.elastic.co/t/remote-access-through-ssh/18991/4 "2014-07-30T23:46:54Z")

</div>

You may want to look at

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

If you are just learning ES, then check out  
[http://exploringelasticsearch.com/](http://exploringelasticsearch.com/)

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 31 July 2014 09:35, Chia-Eng Chang [chiaengc@uci.edu](mailto:chiaengc@uci.edu) wrote:

> Thanks @Mark  
> I have a public key on server and I know how to SSH to server then get the  
> index from localhost:9200.  
> But what I want to do is remotely obtain the index on the SSH server  
> (which I know its public IP)
> 
> On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:
> 
> > You need to use SSH directly for it, curl won't work.
> > 
> > ssh user@host -i ~/.ssh/id\_rsa.pub
> > 
> > Assuming you have a public key on the server.
> > 
> > Regards,  
> > Mark Walkom
> > 
> > Infrastructure Engineer  
> > Campaign Monitor  
> > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > 
> > On 31 July 2014 08:47, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:
> > 
> > > About the HTTP API, I wonder if I want to remote access a cluster on  
> > > SSH server, what should I include in my http rest command:
> > > 
> > > example as mapping:
> > > 
> > > ```
> > > curl -XGET ' http://localhost:9200/ index /_mapping/ type '
> > > 
> > > ```
> > > 
> > > I tried something like below but got failed:
> > > 
> > > ```
> > > curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub 'xx.xxx.xxx.xxx:9200/index/_mapping/type'
> > > 
> > > ```
> > > 
> > > Is there anyone knows the solution?
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).
> > > 
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624Z%2B3wOyb%2BEQFyQvrfiGA-9e%2BwEc1M7AA1QcfM0CbJCdCg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624Z%2B3wOyb%2BEQFyQvrfiGA-9e%2BwEc1M7AA1QcfM0CbJCdCg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Chia\_Eng\_Chang](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@Chia\_Eng\_Chang](https://discuss.elastic.co/u/Chia_Eng_Chang)\
**Post date:** [July 31, 2014, 12:35am UTC](https://discuss.elastic.co/t/remote-access-through-ssh/18991/5 "2014-07-31T00:35:56Z")

</div>

Thank you for the links. Yeah, I am new to ES. (and http rest)  
What I understand is that if I want to get the index documents on my SSH  
server, I can SSH log in the server.  
And then rest http get from localhost:9200.

Could you explain more about "use SSH directly for it"?  
I think what I want to do is close to this transport client example  
[http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#transport-client](http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#transport-client)

But I have to provide ssh credential.

On Wednesday, July 30, 2014 4:47:22 PM UTC-7, Mark Walkom wrote:

> You may want to look at  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html)
> 
> If you are just learning ES, then check out  
> [http://exploringelasticsearch.com/](http://exploringelasticsearch.com/)
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com) \<javascript:\>  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 31 July 2014 09:35, Chia-Eng Chang \<chia...@uci.edu \<javascript:\>\>  
> wrote:
> 
> > Thanks @Mark  
> > I have a public key on server and I know how to SSH to server then get  
> > the index from localhost:9200.  
> > But what I want to do is remotely obtain the index on the SSH server  
> > (which I know its public IP)
> > 
> > On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:
> > 
> > > You need to use SSH directly for it, curl won't work.
> > > 
> > > ssh user@host -i ~/.ssh/id\_rsa.pub
> > > 
> > > Assuming you have a public key on the server.
> > > 
> > > Regards,  
> > > Mark Walkom
> > > 
> > > Infrastructure Engineer  
> > > Campaign Monitor  
> > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > 
> > > On 31 July 2014 08:47, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:
> > > 
> > > > About the HTTP API, I wonder if I want to remote access a cluster on  
> > > > SSH server, what should I include in my http rest command:
> > > > 
> > > > example as mapping:
> > > > 
> > > > ```
> > > > curl -XGET ' http://localhost:9200/ index /_mapping/ type ' 
> > > > 
> > > > ```
> > > > 
> > > > I tried something like below but got failed:
> > > > 
> > > > ```
> > > > curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub 'xx.xxx.xxx.xxx:9200/index/_mapping/type'
> > > > 
> > > > ```
> > > > 
> > > > Is there anyone knows the solution?
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).
> > > > 
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 31, 2014, 12:48am UTC](https://discuss.elastic.co/t/remote-access-through-ssh/18991/6 "2014-07-31T00:48:01Z")

</div>

You can also curl from your local machine to the server, without having to  
SSH to it - curl -XGET [http://IPADDRESS:9200/](http://IPADDRESS:9200/)....

You don't need to provide SSH credentials for that transport client example.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 31 July 2014 10:35, Chia-Eng Chang [chiaengc@uci.edu](mailto:chiaengc@uci.edu) wrote:

> Thank you for the links. Yeah, I am new to ES. (and http rest)  
> What I understand is that if I want to get the index documents on my SSH  
> server, I can SSH log in the server.  
> And then rest http get from localhost:9200.
> 
> Could you explain more about "use SSH directly for it"?  
> I think what I want to do is close to this transport client example  
> [http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#transport-client](http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#transport-client)
> 
> But I have to provide ssh credential.
> 
> On Wednesday, July 30, 2014 4:47:22 PM UTC-7, Mark Walkom wrote:
> 
> > You may want to look at [http://www.elasticsearch](http://www.elasticsearch).  
> > org/guide/en/elasticsearch/reference/current/search.html
> > 
> > If you are just learning ES, then check out http://  
> > [exploringelasticsearch.com/](http://exploringelasticsearch.com/)
> > 
> > Regards,  
> > Mark Walkom
> > 
> > Infrastructure Engineer  
> > Campaign Monitor  
> > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > 
> > On 31 July 2014 09:35, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:
> > 
> > > Thanks @Mark  
> > > I have a public key on server and I know how to SSH to server then get  
> > > the index from localhost:9200.  
> > > But what I want to do is remotely obtain the index on the SSH server  
> > > (which I know its public IP)
> > > 
> > > On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:
> > > 
> > > > You need to use SSH directly for it, curl won't work.
> > > > 
> > > > ssh user@host -i ~/.ssh/id\_rsa.pub
> > > > 
> > > > Assuming you have a public key on the server.
> > > > 
> > > > Regards,  
> > > > Mark Walkom
> > > > 
> > > > Infrastructure Engineer  
> > > > Campaign Monitor  
> > > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > > 
> > > > On 31 July 2014 08:47, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:
> > > > 
> > > > > About the HTTP API, I wonder if I want to remote access a cluster on  
> > > > > SSH server, what should I include in my http rest command:
> > > > > 
> > > > > example as mapping:
> > > > > 
> > > > > ```
> > > > > curl -XGET ' http://localhost:9200/ index /_mapping/ type '
> > > > > 
> > > > > ```
> > > > > 
> > > > > I tried something like below but got failed:
> > > > > 
> > > > > ```
> > > > > curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub 'xx.xxx.xxx.xxx:9200/index/_mapping/type'
> > > > > 
> > > > > ```
> > > > > 
> > > > > Is there anyone knows the solution?
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).
> > > > > 
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40goo  
> > > > > [glegroups.com](http://glegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .  
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624a%2B4ZZeQvjz9sD1xgxqu\_BP%3Db3WJt8PozqPw9hNpNteLw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624a%2B4ZZeQvjz9sD1xgxqu_BP%3Db3WJt8PozqPw9hNpNteLw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Chia\_Eng\_Chang](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@Chia\_Eng\_Chang](https://discuss.elastic.co/u/Chia_Eng_Chang)\
**Post date:** [July 31, 2014, 9:47pm UTC](https://discuss.elastic.co/t/remote-access-through-ssh/18991/7 "2014-07-31T21:47:33Z")

</div>

I tried curl -XGET [http://IPADDRESS:9200/](http://IPADDRESS:9200/).. [http://IPADDRESS:9200/](http://IPADDRESS:9200/).. but  
it failed.  
Actually I cant even telnet port 9200 on my machine.  
My guess is that elasticsearch port 9200 is hidden behind ssh port 22.

So I use ssh tunnel forwarding port 9200 on the server to my machine.  
Like :

ssh -L:: user@

Then I can simply apply curl -get localhost:9200 to query elasticsearch on my cloud server.  
The java api transpot client might need the same setting to make it work.

On Wednesday, July 30, 2014 5:48:28 PM UTC-7, Mark Walkom wrote:

> You can also curl from your local machine to the server, without having to  
> SSH to it - curl -XGET [http://IPADDRESS:9200/](http://IPADDRESS:9200/)....
> 
> You don't need to provide SSH credentials for that transport client  
> example.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com) \<javascript:\>  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 31 July 2014 10:35, Chia-Eng Chang \<chia...@uci.edu \<javascript:\>\>  
> wrote:
> 
> > Thank you for the links. Yeah, I am new to ES. (and http rest)  
> > What I understand is that if I want to get the index documents on my SSH  
> > server, I can SSH log in the server.  
> > And then rest http get from localhost:9200.
> > 
> > Could you explain more about "use SSH directly for it"?  
> > I think what I want to do is close to this transport client example  
> > [http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#transport-client](http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#transport-client)
> > 
> > But I have to provide ssh credential.
> > 
> > On Wednesday, July 30, 2014 4:47:22 PM UTC-7, Mark Walkom wrote:
> > 
> > > You may want to look at [http://www.elasticsearch](http://www.elasticsearch).  
> > > org/guide/en/elasticsearch/reference/current/search.html
> > > 
> > > If you are just learning ES, then check out http://  
> > > [exploringelasticsearch.com/](http://exploringelasticsearch.com/)
> > > 
> > > Regards,  
> > > Mark Walkom
> > > 
> > > Infrastructure Engineer  
> > > Campaign Monitor  
> > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > 
> > > On 31 July 2014 09:35, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:
> > > 
> > > > Thanks @Mark  
> > > > I have a public key on server and I know how to SSH to server then get  
> > > > the index from localhost:9200.  
> > > > But what I want to do is remotely obtain the index on the SSH server  
> > > > (which I know its public IP)
> > > > 
> > > > On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:
> > > > 
> > > > > You need to use SSH directly for it, curl won't work.
> > > > > 
> > > > > ssh user@host -i ~/.ssh/id\_rsa.pub
> > > > > 
> > > > > Assuming you have a public key on the server.
> > > > > 
> > > > > Regards,  
> > > > > Mark Walkom
> > > > > 
> > > > > Infrastructure Engineer  
> > > > > Campaign Monitor  
> > > > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > > > 
> > > > > On 31 July 2014 08:47, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:
> > > > > 
> > > > > > About the HTTP API, I wonder if I want to remote access a cluster  
> > > > > > on SSH server, what should I include in my http rest command:
> > > > > > 
> > > > > > example as mapping:
> > > > > > 
> > > > > > ```
> > > > > > curl -XGET ' http://localhost:9200/ index /_mapping/ type ' 
> > > > > > 
> > > > > > ```
> > > > > > 
> > > > > > I tried something like below but got failed:
> > > > > > 
> > > > > > ```
> > > > > > curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub 'xx.xxx.xxx.xxx:9200/index/_mapping/type'
> > > > > > 
> > > > > > ```
> > > > > > 
> > > > > > Is there anyone knows the solution?
> > > > > > 
> > > > > > --  
> > > > > > You received this message because you are subscribed to the Google  
> > > > > > Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).
> > > > > > 
> > > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > > msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40goo  
> > > > > > [glegroups.com](http://glegroups.com)  
> > > > > > [https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > .  
> > > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%  
> > > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .
> > > > 
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/06704857-de0d-493f-b8fb-ffce6a258b09%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/06704857-de0d-493f-b8fb-ffce6a258b09%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Patrick\_Proniewski](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@Patrick\_Proniewski](https://discuss.elastic.co/u/Patrick_Proniewski)\
**Post date:** [July 31, 2014, 9:58pm UTC](https://discuss.elastic.co/t/remote-access-through-ssh/18991/8 "2014-07-31T21:58:18Z")

</div>

Hi,

Looks like your problem is not related to ES. It's a networking problem. You ES server appears to live behind a firewall (or is bind to 127.0.0.1 only), and your only way to contact it is to create an ssh tunnel to the server and to pipe your queries into this tunnel so that you can get in touch with the ES process.

You might want to get in touch with your hosting provider. Also, if you can run a web server (apache, nginx...) on your server, you might want to configure a proxy in this web server, so that requests sent to a particular URL will be redirected to the ES process. You would have something like this:

client ----\> (public IP, port 80 or 443) http-server -\> (localhost port 9200) ES process

It allows you to add some kind of access control to the ES process by using access control directives from Apache or Nginx.

On 31 juil. 2014, at 23:47, Chia-Eng Chang wrote:

> I tried curl -XGET [http://IPADDRESS:9200/](http://IPADDRESS:9200/).... but it failed.  
> Actually I cant even telnet port 9200 on my machine.  
> My guess is that elasticsearch port 9200 is hidden behind ssh port 22.
> 
> So I use ssh tunnel forwarding port 9200 on the server to my machine.  
> Like :  
> ssh -L:: user@
> 
> Then I can simply apply curl -get localhost:9200 to query elasticsearch on my cloud server.  
> The java api transpot client might need the same setting to make it work.
> 
> On Wednesday, July 30, 2014 5:48:28 PM UTC-7, Mark Walkom wrote:  
> You can also curl from your local machine to the server, without having to SSH to it - curl -XGET [http://IPADDRESS:9200/](http://IPADDRESS:9200/)....
> 
> You don't need to provide SSH credentials for that transport client example.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 31 July 2014 10:35, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:  
> Thank you for the links. Yeah, I am new to ES. (and http rest)  
> What I understand is that if I want to get the index documents on my SSH server, I can SSH log in the server.  
> And then rest http get from localhost:9200.
> 
> Could you explain more about "use SSH directly for it"?  
> I think what I want to do is close to this transport client example  
> But I have to provide ssh credential.
> 
> On Wednesday, July 30, 2014 4:47:22 PM UTC-7, Mark Walkom wrote:  
> You may want to look at [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html)
> 
> If you are just learning ES, then check out [http://exploringelasticsearch.com/](http://exploringelasticsearch.com/)
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 31 July 2014 09:35, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:  
> Thanks @Mark  
> I have a public key on server and I know how to SSH to server then get the index from localhost:9200.  
> But what I want to do is remotely obtain the index on the SSH server (which I know its public IP)
> 
> On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:  
> You need to use SSH directly for it, curl won't work.
> 
> ssh user@host -i ~/.ssh/id\_rsa.pub
> 
> Assuming you have a public key on the server.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 31 July 2014 08:47, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:  
> About the HTTP API, I wonder if I want to remote access a cluster on SSH server, what should I include in my http rest command:
> 
> example as mapping:
> 
> ```
> curl -XGET ' http://localhost:9200/
> 
> ```
> 
> index /\_mapping/ type '
> 
> I tried something like below but got failed:
> 
> ```
> curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub 'xx.xxx.xxx.xxx:9200/index/_ma
> 
> ```
> 
> pping/type'
> 
> Is there anyone knows the solution?
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).
> 
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com).
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com).
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/06704857-de0d-493f-b8fb-ffce6a258b09%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/06704857-de0d-493f-b8fb-ffce6a258b09%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9E8CA652-DEAB-41A2-920E-23EA3DC5F94F%40patpro.net](https://groups.google.com/d/msgid/elasticsearch/9E8CA652-DEAB-41A2-920E-23EA3DC5F94F%40patpro.net).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![error804](https://avatars.discourse-cdn.com/v4/letter/e/58956e/32.png) [@error804](https://discuss.elastic.co/u/error804)\
**Post date:** [August 1, 2014, 9:16am UTC](https://discuss.elastic.co/t/remote-access-through-ssh/18991/9 "2014-08-01T09:16:20Z")

</div>

Why dont you try

```
ssh -i ~/.ssh/id_rsa xx.xxx.xxx.xxx 'curl -XGET

```

localhost:9200/index/\_mapping/type'

cheers

On Fri, Aug 1, 2014 at 3:43 AM, Patrick Proniewski \<[elasticsearch@patpro.net](mailto:elasticsearch@patpro.net)

> wrote:

> Hi,
> 
> Looks like your problem is not related to ES. It's a networking problem.  
> You ES server appears to live behind a firewall (or is bind to 127.0.0.1  
> only), and your only way to contact it is to create an ssh tunnel to the  
> server and to pipe your queries into this tunnel so that you can get in  
> touch with the ES process.
> 
> You might want to get in touch with your hosting provider. Also, if you  
> can run a web server (apache, nginx...) on your server, you might want to  
> configure a proxy in this web server, so that requests sent to a particular  
> URL will be redirected to the ES process. You would have something like  
> this:
> 
> client ----\> (public IP, port 80 or 443) http-server -\> (localhost port  
> 9200) ES process
> 
> It allows you to add some kind of access control to the ES process by  
> using access control directives from Apache or Nginx.
> 
> On 31 juil. 2014, at 23:47, Chia-Eng Chang wrote:
> 
> > I tried curl -XGET [http://IPADDRESS:9200/](http://IPADDRESS:9200/).... but it failed.  
> > Actually I cant even telnet port 9200 on my machine.  
> > My guess is that elasticsearch port 9200 is hidden behind ssh port 22.
> > 
> > So I use ssh tunnel forwarding port 9200 on the server to my machine.  
> > Like :  
> > ssh -L:: user@
> > 
> > Then I can simply apply curl -get localhost:9200 to query elasticsearch  
> > on my cloud server.  
> > The java api transpot client might need the same setting to make it work.
> > 
> > On Wednesday, July 30, 2014 5:48:28 PM UTC-7, Mark Walkom wrote:  
> > You can also curl from your local machine to the server, without having  
> > to SSH to it - curl -XGET [http://IPADDRESS:9200/](http://IPADDRESS:9200/)....
> > 
> > You don't need to provide SSH credentials for that transport client  
> > example.
> > 
> > Regards,  
> > Mark Walkom
> > 
> > Infrastructure Engineer  
> > Campaign Monitor  
> > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > 
> > On 31 July 2014 10:35, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:  
> > Thank you for the links. Yeah, I am new to ES. (and http rest)  
> > What I understand is that if I want to get the index documents on my SSH  
> > server, I can SSH log in the server.  
> > And then rest http get from localhost:9200.
> > 
> > Could you explain more about "use SSH directly for it"?  
> > I think what I want to do is close to this transport client example  
> > But I have to provide ssh credential.
> > 
> > On Wednesday, July 30, 2014 4:47:22 PM UTC-7, Mark Walkom wrote:  
> > You may want to look at  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html)
> > 
> > If you are just learning ES, then check out  
> > [http://exploringelasticsearch.com/](http://exploringelasticsearch.com/)
> > 
> > Regards,  
> > Mark Walkom
> > 
> > Infrastructure Engineer  
> > Campaign Monitor  
> > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > 
> > On 31 July 2014 09:35, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:  
> > Thanks @Mark  
> > I have a public key on server and I know how to SSH to server then get  
> > the index from localhost:9200.  
> > But what I want to do is remotely obtain the index on the SSH server  
> > (which I know its public IP)
> > 
> > On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:  
> > You need to use SSH directly for it, curl won't work.
> > 
> > ssh user@host -i ~/.ssh/id\_rsa.pub
> > 
> > Assuming you have a public key on the server.
> > 
> > Regards,  
> > Mark Walkom
> > 
> > Infrastructure Engineer  
> > Campaign Monitor  
> > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > 
> > On 31 July 2014 08:47, Chia-Eng Chang [chia...@uci.edu](mailto:chia...@uci.edu) wrote:  
> > About the HTTP API, I wonder if I want to remote access a cluster on SSH  
> > server, what should I include in my http rest command:
> > 
> > example as mapping:
> > 
> > ```
> > curl -XGET ' http://localhost:9200/
> > 
> > ```
> > 
> > index /\_mapping/ type '
> > 
> > I tried something like below but got failed:
> > 
> > ```
> > curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey
> > 
> > ```
> 
> ~/.ssh/id\_rsa.pub 'xx.xxx.xxx.xxx:9200/index/\_ma
> 
> > pping/type'
> > 
> > Is there anyone knows the solution?
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).
> > 
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/06704857-de0d-493f-b8fb-ffce6a258b09%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/06704857-de0d-493f-b8fb-ffce6a258b09%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/9E8CA652-DEAB-41A2-920E-23EA3DC5F94F%40patpro.net](https://groups.google.com/d/msgid/elasticsearch/9E8CA652-DEAB-41A2-920E-23EA3DC5F94F%40patpro.net)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAMUueYndb%2BRQhZmgu2xfMgk%3Dj5vUyyDc17OEmxYckNtgrtVuKA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMUueYndb%2BRQhZmgu2xfMgk%3Dj5vUyyDc17OEmxYckNtgrtVuKA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:11am UTC](https://discuss.elastic.co/t/remote-access-through-ssh/18991/10 "2017-07-06T01:11:44Z")

</div>


