<?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: Python script - unable to set encrypted preshared key in DevNet General Discussions</title>
    <link>https://community.cisco.com/t5/devnet-general-discussions/python-script-unable-to-set-encrypted-preshared-key/m-p/4998618#M2186</link>
    <description>&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import cli

cli.enable()
cli.configure(["crypto key generate rsa general-keys modulus 1024"])

config = [
    "password encryption aes",
    "key config-key password-encrypt MYKEY"
]

cli.configure(config)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;The &lt;/SPAN&gt;cli.configure()&lt;SPAN&gt; method takes a list of configuration commands and executes them in config mode.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2024 15:27:41 GMT</pubDate>
    <dc:creator>bigevilbeard</dc:creator>
    <dc:date>2024-01-17T15:27:41Z</dc:date>
    <item>
      <title>Python script - unable to set encrypted preshared key</title>
      <link>https://community.cisco.com/t5/devnet-general-discussions/python-script-unable-to-set-encrypted-preshared-key/m-p/4998593#M2185</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'm trying to set an&amp;nbsp;encrypted preshared key on a C9200 (ver 17.06.05) with a python script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When executing the following script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import cli
cli.configurep([
	"password encryption aes",
	"key config-key password-encrypt MYKEY"
])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following output :&lt;/P&gt;&lt;P&gt;Line 1 SUCCESS: password encryption aes&lt;BR /&gt;Line 2 SUCCESS: key config-key password-encrypt MYKEY&lt;/P&gt;&lt;P&gt;However the second line is not configured.&lt;/P&gt;&lt;P&gt;Did I miss something ?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 06:51:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-general-discussions/python-script-unable-to-set-encrypted-preshared-key/m-p/4998593#M2185</guid>
      <dc:creator>MrNox</dc:creator>
      <dc:date>2024-01-18T06:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Python script - unable to set encrypted preshared key</title>
      <link>https://community.cisco.com/t5/devnet-general-discussions/python-script-unable-to-set-encrypted-preshared-key/m-p/4998618#M2186</link>
      <description>&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import cli

cli.enable()
cli.configure(["crypto key generate rsa general-keys modulus 1024"])

config = [
    "password encryption aes",
    "key config-key password-encrypt MYKEY"
]

cli.configure(config)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;The &lt;/SPAN&gt;cli.configure()&lt;SPAN&gt; method takes a list of configuration commands and executes them in config mode.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 15:27:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-general-discussions/python-script-unable-to-set-encrypted-preshared-key/m-p/4998618#M2186</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-01-17T15:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python script - unable to set encrypted preshared key</title>
      <link>https://community.cisco.com/t5/devnet-general-discussions/python-script-unable-to-set-encrypted-preshared-key/m-p/4998742#M2188</link>
      <description>&lt;P&gt;First try, I had to remove ,cli.enable() because of this : "AttributeError: module 'cli' has no attribute 'enable''"&lt;/P&gt;&lt;P&gt;After a second try, the rsa key pairs were generated successfully. The "password encryption aes" command was executed successfully but the "key config-key password-encrypt MYKEY" command still fails to work.&amp;nbsp;&lt;SPAN&gt;When trying to set an encrypted key for radius or tacacs+ servers, I receive invalid key error messages. This suggests that&amp;nbsp;encrypted preshared key is not set properly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 18:02:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-general-discussions/python-script-unable-to-set-encrypted-preshared-key/m-p/4998742#M2188</guid>
      <dc:creator>MrNox</dc:creator>
      <dc:date>2024-01-17T18:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python script - unable to set encrypted preshared key</title>
      <link>https://community.cisco.com/t5/devnet-general-discussions/python-script-unable-to-set-encrypted-preshared-key/m-p/5011757#M2205</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/825367"&gt;@MrNox&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Has this been resolved?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 09:54:51 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-general-discussions/python-script-unable-to-set-encrypted-preshared-key/m-p/5011757#M2205</guid>
      <dc:creator>Ruben Cocheno</dc:creator>
      <dc:date>2024-02-02T09:54:51Z</dc:date>
    </item>
  </channel>
</rss>

