<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to establish NETCONF sessions from a remote server to Cisco CSR 1000v using the downloaded RSA key? in Tools</title>
    <link>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3785894#M2195</link>
    <description>&lt;P&gt;Well, this is my code&lt;/P&gt;&lt;PRE&gt; provider = NetconfServiceProvider(address="ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com",&lt;BR /&gt; username="ec2-user",&lt;BR /&gt; public_key_path="/home/server/shared_files/mykey.pem"&lt;BR /&gt; )&lt;/PRE&gt;&lt;P&gt;I'm still getting the same error :/&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Traceback (most recent call last):&lt;BR /&gt; File "hello-ydk.py", line 17, in &amp;lt;module&amp;gt;&lt;BR /&gt; public_key_path="/home/server/shared_files/mykey.pem"&lt;BR /&gt;TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:&lt;BR /&gt; 1. ydk_.providers.NetconfServiceProvider(repo: ydk_.path.Repository, address: unicode, username: unicode, password: unicode, port: int=830L, protocol: unicode=u'ssh', on_demand: bool=True, timeout: int=-1L)&lt;BR /&gt; 2. ydk_.providers.NetconfServiceProvider(address: unicode, username: unicode, password: unicode, port: int=830L, protocol: unicode=u'ssh', on_demand: bool=True, common_cache: bool=False, timeout: int=-1L)&lt;BR /&gt; 3. ydk_.providers.NetconfServiceProvider(repo: ydk_.path.Repository, address: unicode, username: unicode, private_key_path: unicode, public_key_path: unicode, port: int=830L, on_demand: bool=True, timeout: int=-1L)&lt;BR /&gt; 4. ydk_.providers.NetconfServiceProvider(address: unicode, username: unicode, private_key_path: unicode, public_key_path: unicode, port: int=830L, on_demand: bool=True, common_cache: bool=False, timeout: int=-1L)&lt;BR /&gt;&lt;BR /&gt;Invoked with: kwargs: username='ec2-user', public_key_path='/home/server/shared_files/mykey.pem', address='ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jan 2019 09:08:05 GMT</pubDate>
    <dc:creator>khalilmeb</dc:creator>
    <dc:date>2019-01-23T09:08:05Z</dc:date>
    <item>
      <title>How to establish NETCONF sessions from a remote server to Cisco CSR 1000v using the downloaded RSA key?</title>
      <link>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3785150#M2192</link>
      <description>&lt;P&gt;I'm running docker Yang Development Kit for python&amp;nbsp;ydk-py&amp;nbsp;in my remote server Linux Ubuntu. I would like to Establish a connection using&amp;nbsp;with the remote server and my AWS EC2 instance that runs&amp;nbsp;CSR 1000v.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used to access to my router using the following ssh command:&lt;/P&gt;&lt;PRE&gt;ssh -i "ssh-key.pem" ec2-user@ec2-xx-xx-xx-xxx.us-west-2.compute.amazonaws.com&lt;/PRE&gt;&lt;P&gt;Where ec2-xx-xx-xx-xxx.us-west-2.compute.amazonaws.com is the hostname,&amp;nbsp;ec2-user is the username and the ssh key is for authentification.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As the first step, I want to run the given example in here&amp;nbsp;&lt;A href="https://github.com/CiscoDevNet/ydk-py-samples" target="_blank"&gt;https://github.com/CiscoDevNet/ydk-py-samples&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is&amp;nbsp;the creation of NETCONF session in the given example:&lt;/P&gt;&lt;PRE&gt;    provider &lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt; NetconfServiceProvider(&lt;SPAN class="pl-v"&gt;address&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;10.0.0.1&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;,
                                      &lt;SPAN class="pl-v"&gt;port&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pl-c1"&gt;830&lt;/SPAN&gt;,
                                      &lt;SPAN class="pl-v"&gt;username&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;admin&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;,
                                      &lt;SPAN class="pl-v"&gt;password&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;admin&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;,
                                      &lt;SPAN class="pl-v"&gt;protocol&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;ssh&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="GFRVLNABMJ GFRVLNABOJ"&gt;&lt;SPAN&gt;If&amp;nbsp;we take a look,&amp;nbsp;&lt;/SPAN&gt;HOST&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;USERNAME&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;PASSWORK&lt;SPAN&gt;&amp;nbsp;are needed to establish the connection between the router and the host machine. It happens that I use&amp;nbsp;&lt;/SPAN&gt;SSH key&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;downloaeded from&amp;nbsp;&lt;/SPAN&gt;AWS console&lt;SPAN&gt;&amp;nbsp;in order to access to the&amp;nbsp;&lt;/SPAN&gt;EC2&lt;SPAN&gt;&amp;nbsp;instance.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In another word, how to establish NETCONF sessions from a remote server to Cisco CSR 1000v using the downloaded RSA key?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 15:12:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3785150#M2192</guid>
      <dc:creator>khalilmeb</dc:creator>
      <dc:date>2019-01-22T15:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to establish NETCONF sessions from a remote server to Cisco CSR 1000v using the downloaded RSA key?</title>
      <link>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3785261#M2193</link>
      <description>&lt;P&gt;I have tried this&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;provider = NetconfServiceProvider("ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com", &lt;BR /&gt; "ec2-user", &lt;BR /&gt; port=830, &lt;BR /&gt; protocol='ssh', &lt;BR /&gt; timeout=-1, &lt;BR /&gt; repo=None, &lt;BR /&gt; private_key_path="mykey.pem")&lt;/PRE&gt;&lt;P&gt;I have got this error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="s1"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;File "hello-ydk.py", line 18, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;private_key_path="mykey.pem")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s1"&gt;TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;1. ydk_.providers.NetconfServiceProvider(repo: ydk_.path.Repository, address: unicode, username: unicode, password: unicode, port: int=830L, protocol: unicode=u'ssh', on_demand: bool=True, timeout: int=-1L)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;2. ydk_.providers.NetconfServiceProvider(address: unicode, username: unicode, password: unicode, port: int=830L, protocol: unicode=u'ssh', on_demand: bool=True, common_cache: bool=False, timeout: int=-1L)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;3. ydk_.providers.NetconfServiceProvider(repo: ydk_.path.Repository, address: unicode, username: unicode, private_key_path: unicode, public_key_path: unicode, port: int=830L, on_demand: bool=True, timeout: int=-1L)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;4. ydk_.providers.NetconfServiceProvider(address: unicode, username: unicode, private_key_path: unicode, public_key_path: unicode, port: int=830L, on_demand: bool=True, common_cache: bool=False, timeout: int=-1L)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="s1"&gt;Invoked with: 'ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com', 'ec2-user'; kwargs: repo=None, private_key_path='mykey.pem', protocol='ssh', port=830, timeout=-1&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Jan 2019 17:11:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3785261#M2193</guid>
      <dc:creator>khalilmeb</dc:creator>
      <dc:date>2019-01-22T17:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to establish NETCONF sessions from a remote server to Cisco CSR 1000v using the downloaded RSA key?</title>
      <link>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3785310#M2194</link>
      <description>&lt;P&gt;Hello khalilmeb&lt;/P&gt;
&lt;P&gt;The certificate downloaded from server is actually its public key. Therefore please try this:&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt;provider = NetconfServiceProvider("ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt; "ec2-user",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="courier new,courier" color="#000080"&gt; public_key_path="mykey.pem")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The rest of parameters should take default values. I actually prefer to specify full path for the file location to avoid confusion with working directory location.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Yan&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 17:54:42 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3785310#M2194</guid>
      <dc:creator>ygorelik</dc:creator>
      <dc:date>2019-01-22T17:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to establish NETCONF sessions from a remote server to Cisco CSR 1000v using the downloaded RSA key?</title>
      <link>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3785894#M2195</link>
      <description>&lt;P&gt;Well, this is my code&lt;/P&gt;&lt;PRE&gt; provider = NetconfServiceProvider(address="ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com",&lt;BR /&gt; username="ec2-user",&lt;BR /&gt; public_key_path="/home/server/shared_files/mykey.pem"&lt;BR /&gt; )&lt;/PRE&gt;&lt;P&gt;I'm still getting the same error :/&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Traceback (most recent call last):&lt;BR /&gt; File "hello-ydk.py", line 17, in &amp;lt;module&amp;gt;&lt;BR /&gt; public_key_path="/home/server/shared_files/mykey.pem"&lt;BR /&gt;TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:&lt;BR /&gt; 1. ydk_.providers.NetconfServiceProvider(repo: ydk_.path.Repository, address: unicode, username: unicode, password: unicode, port: int=830L, protocol: unicode=u'ssh', on_demand: bool=True, timeout: int=-1L)&lt;BR /&gt; 2. ydk_.providers.NetconfServiceProvider(address: unicode, username: unicode, password: unicode, port: int=830L, protocol: unicode=u'ssh', on_demand: bool=True, common_cache: bool=False, timeout: int=-1L)&lt;BR /&gt; 3. ydk_.providers.NetconfServiceProvider(repo: ydk_.path.Repository, address: unicode, username: unicode, private_key_path: unicode, public_key_path: unicode, port: int=830L, on_demand: bool=True, timeout: int=-1L)&lt;BR /&gt; 4. ydk_.providers.NetconfServiceProvider(address: unicode, username: unicode, private_key_path: unicode, public_key_path: unicode, port: int=830L, on_demand: bool=True, common_cache: bool=False, timeout: int=-1L)&lt;BR /&gt;&lt;BR /&gt;Invoked with: kwargs: username='ec2-user', public_key_path='/home/server/shared_files/mykey.pem', address='ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 09:08:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3785894#M2195</guid>
      <dc:creator>khalilmeb</dc:creator>
      <dc:date>2019-01-23T09:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to establish NETCONF sessions from a remote server to Cisco CSR 1000v using the downloaded RSA key?</title>
      <link>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3785914#M2196</link>
      <description>&lt;P&gt;&amp;nbsp;In the README file in here&amp;nbsp;&lt;A href="https://github.com/CiscoDevNet/ydk-py-samples/blob/master/samples/basic/README.md" target="_blank"&gt;https://github.com/CiscoDevNet/ydk-py-samples/blob/master/samples/basic/README.md&lt;/A&gt; the running a sample app is the following:&lt;/P&gt;&lt;P&gt;Unless specified by the app, all basic apps take two command line arguments. An optional argument (-v | --verbose) to enable logging and a mandatory argument in URL format that describes the connection details to the networking device (ssh://user:password@device:port):&lt;/P&gt;&lt;PRE&gt;$ ./nc-read-xr-ip-ntp-oper-10-ydk.py ssh://admin:admin@10.0.0.1&lt;/PRE&gt;&lt;P&gt;So in my case, it should be like this, right?&lt;/P&gt;&lt;PRE&gt;$ ./hello-ydk.py ssh://ec2-user:ec2-user@ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But still did not work&lt;/P&gt;&lt;PRE&gt;from: can't read /var/mail/ydk.services&lt;BR /&gt;from: can't read /var/mail/ydk.providers&lt;BR /&gt;from: can't read /var/mail/ydk.models.cisco_ios_xr&lt;BR /&gt;from: can't read /var/mail/datetime&lt;BR /&gt;./hello-ydk.py: 13: ./hello-ydk.py: Syntax error: "(" unexpected (expecting "then")&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Jan 2019 09:27:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3785914#M2196</guid>
      <dc:creator>khalilmeb</dc:creator>
      <dc:date>2019-01-23T09:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to establish NETCONF sessions from a remote server to Cisco CSR 1000v using the downloaded RSA key?</title>
      <link>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3787247#M2197</link>
      <description>&lt;P&gt;I tired the following.&lt;/P&gt;&lt;PRE&gt;provider = NetconfServiceProvider(address="ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com",&lt;BR /&gt; username="ec2-user", &lt;BR /&gt; private_key_path="/home/server/shared_files/mykey.pem")&lt;/PRE&gt;&lt;P&gt;I tried to debug the python script and it turns out that there is a problem with argument type which is private_key_path for the code above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;-&amp;gt; username="ec2-user",&lt;BR /&gt;(Pdb) next&lt;BR /&gt;&amp;gt; /home/server/shared_files/hello-ydk.py(15)&amp;lt;module&amp;gt;()&lt;BR /&gt;-&amp;gt; private_key_path="/home/server/shared_files/mykey.pem")&lt;BR /&gt;(Pdb) next&lt;BR /&gt;TypeError: "__init__(): incompatible constructor arguments. The following argument types are supported:\n .../home/server/shared_files/mykey.pem', address='ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com'"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I solve this issue?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 13:51:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3787247#M2197</guid>
      <dc:creator>khalilmeb</dc:creator>
      <dc:date>2019-01-24T13:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to establish NETCONF sessions from a remote server to Cisco CSR 1000v using the downloaded RSA key?</title>
      <link>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3795259#M2198</link>
      <description>The NETCONF provider does support key-based authentication.  Take a look at the documentation:&lt;BR /&gt;&lt;A href="http://ydk.cisco.com/py/docs/api/providers/netconf_provider.html" target="_blank"&gt;http://ydk.cisco.com/py/docs/api/providers/netconf_provider.html&lt;/A&gt;&lt;BR /&gt;Can't find a working example, but specifying the router public key, user name and no password should suffice.&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Tue, 05 Feb 2019 17:50:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/how-to-establish-netconf-sessions-from-a-remote-server-to-cisco/m-p/3795259#M2198</guid>
      <dc:creator>saalvare</dc:creator>
      <dc:date>2019-02-05T17:50:07Z</dc:date>
    </item>
  </channel>
</rss>

