# Opening a root file from a server with password

**URL:** <https://root-forum.cern.ch/t/opening-a-root-file-from-a-server-with-password/32351>\
**Category:** Newbie\
**Created:** [January 18, 2019, 11:28am UTC](https://root-forum.cern.ch/t/opening-a-root-file-from-a-server-with-password/32351 "2019-01-18T11:28:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonio.iuliano2](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/antonio.iuliano2/32/24948_2.png) [@antonio.iuliano2](https://root-forum.cern.ch/u/antonio.iuliano2)\
**Post date:** [January 18, 2019, 11:28am UTC](https://root-forum.cern.ch/t/opening-a-root-file-from-a-server-with-password/32351/1 "2019-01-18T11:28:38Z")

</div>

Dear ROOT expert,

I need to open ROOT files from a server, without connecting to it using ssh.

I have trying to use BasicAuth connection of TFile:  
TFile \*h = TFile::Open(“[https://myusername:mypassword@nusrv9.na.infn.it](https://myusername:mypassword@nusrv9.na.infn.it):/path/file.root”)

and it returned this error:

SysError in TUnixSystem::UnixTcpConnect: connect (nusrv9.na.infn.it:443) (Connection refused)  
Error in TSSLSocket::WrapWithSSL: cannot connect  
Error in TWebFile::GetHead: cannot connect to host nusrv9.na.infn.it (errno=9)  
SysError in TUnixSystem::UnixTcpConnect: connect (nusrv9.na.infn.it:443) (Connection refused)  
Error in TSSLSocket::WrapWithSSL: cannot connect  
Error in TWebSocket::ReOpen: cannot connect to host nusrv9.na.infn.it (errno=9)  
Error in TWebFile::GetFromWeb10: cannot connect to host nusrv9.na.infn.it

Therefore, I assume BasicAuth does not work. What can be done then?  
I have found some threads in this forum describing this problem, but nowhere with a working answer.

Is there something I can do to access my ROOT file remotely?

Best regards,  
Antonio

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 18, 2019, 11:33am UTC](https://root-forum.cern.ch/t/opening-a-root-file-from-a-server-with-password/32351/2 "2019-01-18T11:33:17Z")

</div>

For “https”, you need any “standard” ROOT 6 distribution and if you still get problems then I think it is a problem of the www server (note: the “:” before “/path” is not really needed).  
Make sure that you are able to access your file in a “standard” web browser (e.g. “firefox”), when you try `https://nusrv9.na.infn.it/path/file.root` (it should ask you for the “myusername” and “mypassword”).

---

<div class="post-metadata">

**Author:** ![antonio.iuliano2](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/antonio.iuliano2/32/24948_2.png) [@antonio.iuliano2](https://root-forum.cern.ch/u/antonio.iuliano2)\
**Post date:** [January 18, 2019, 12:37pm UTC](https://root-forum.cern.ch/t/opening-a-root-file-from-a-server-with-password/32351/3 "2019-01-18T12:37:34Z")

</div>

Thank you for your answer,

unfortunately opening the link with firefox does not work (it shows firefox connection problem).

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 18, 2019, 12:40pm UTC](https://root-forum.cern.ch/t/opening-a-root-file-from-a-server-with-password/32351/4 "2019-01-18T12:40:54Z")

</div>

Just to make sure … you do understand that [the “myusername” and “mypassword” that you use for “https”](https://en.wikipedia.org/wiki/.htpasswd) are (in principle / usually) NOT the same as you use for e.g. [the standard “ssh” login](https://en.wikipedia.org/wiki/Secure_Shell).

---

<div class="post-metadata">

**Author:** ![antonio.iuliano2](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/antonio.iuliano2/32/24948_2.png) [@antonio.iuliano2](https://root-forum.cern.ch/u/antonio.iuliano2)\
**Post date:** [January 18, 2019, 3:07pm UTC](https://root-forum.cern.ch/t/opening-a-root-file-from-a-server-with-password/32351/5 "2019-01-18T15:07:34Z")

</div>

I actually did not know that.

However, firefox does not ask me for a password at all. It just shows the error of failed connection.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 18, 2019, 4:05pm UTC](https://root-forum.cern.ch/t/opening-a-root-file-from-a-server-with-password/32351/6 "2019-01-18T16:05:54Z")

</div>

Just to make sure … you do understand that [using “https://” (or “http://”) means that you are accessing some web server (which needs to be running there)](https://en.wikipedia.org/wiki/Web_server).

---

<div class="post-metadata">

**Author:** ![antonio.iuliano2](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/antonio.iuliano2/32/24948_2.png) [@antonio.iuliano2](https://root-forum.cern.ch/u/antonio.iuliano2)\
**Post date:** [January 21, 2019, 8:15am UTC](https://root-forum.cern.ch/t/opening-a-root-file-from-a-server-with-password/32351/7 "2019-01-21T08:15:23Z")

</div>

Good morning,  
I can connect to ELOG of nusrv9.na.infn.it:8080 ([https://elog.psi.ch/elog/](https://elog.psi.ch/elog/)) from the computers connected to the same net, so I thought a web server was already active. But maybe ELOG works in a different way.

I will check, thank you very much for pointing this out.

Best regards,  
Antonio
