Microsoft Virtualization Discussions

powershell cmdlet for security login publickey cli

AdaikkappanArumugam

Hi Powershell Experts,

                I am looking for the powershell cmdlet that does the following cli equivalent.

 

security  login publickey  create -username (account) -comment (change control #) -vserver (clustername) -index 0 -publickey (ssh key)

 

If there is none, I will use the Inovke-NcSsh. But before that wanted to check with the experts.

 

Thanks

Adai

 

7 REPLIES 7

mcgue

Does New-NcUser get you what you are looking for?

coreywanless

'New-NcUser' will allow you to create the user and allow publickey as an authentication method, but it doesn't allow you to upload your public key.  (At least in any combination I have tried)

mcgue

I looked at the 3.3 toolkit and the new security key items are for the key server options for running encrypted disks, so that doesn't look like it will help.  It looks like the suggestion that Adai has for you above is the best way to get this done now.

korns

I'm not sure this is an answer but I did just read the Toolkit announce in the forum on DataONTAP PSTK 3.3 (inside  new NetApp  ontap/santricty/mars PSTK) which ays with ontap 8.3.1 and this new TK there are 7 new 'Security Key Mgmt' cmdlets.

coreywanless

Unfortunately, there is no direct powershell commandlet for this. What I have done to get around this is to utilize the "invoke-ncssh" command to run the command.  Sorry to be a disappointment in this area. 

Thats what I ended up doing...

$command = "security login publickey create  -username $($userList.userName) -index 1 -publickey ""$($userList.publicKey)"""

Invoke-NcSsh $command

 

 

Do note the multiple quotes around the key.

 

Regards

Adai

JGPSHNTAP

I haven't had much luck searching as well.

 

Im curious if this is going to be for a domain implementation for ssh keys

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public