Subscribe

powershell cmdlet for security login publickey cli

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

 

Re: powershell cmdlet for security login publickey cli

I haven't had much luck searching as well.

 

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

Re: powershell cmdlet for security login publickey cli

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. 

Re: powershell cmdlet for security login publickey cli

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.

Re: powershell cmdlet for security login publickey cli

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

Re: powershell cmdlet for security login publickey cli

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

Re: powershell cmdlet for security login publickey cli

'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)

Re: powershell cmdlet for security login publickey cli

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.