Configuring NetApp to use SSH with keys without having the root volume holding /etc NFS exported or CIFS shared can be convoluted.
Before I get to the steps, let me list the assumptions:
- The steps below will be for a non-root user
- Root/Administrator privs are available to the user who is setting this up.
- The SSH key for the non-root user has already been generated on the client system.
- The SSH key can be done with a copy/paste from something reading the file (e.g. xterm or notepad) into a shell window with the CLI login into the filer (e.g. xterm or puTTY)
Basically, the trick is to setup the empty user directories since there isn’t a command to create directories. Obviously, with NFS or CIFS, the directory can be made fairly easily.
- Login into filer via CLI with appropriate privileges.
- # go into advanced mode
priv set advanced
- # find an empty directory using
ls
– in some cases,/home/http
may be empty.ls /home/http
- # check ndmpd status
ndmpd status
- # if ndmp is not on, turn it on.
ndmpd on
- # When using
ndmpcopy
, the shortcut of dropping/vol/<root volume>
does not work for the destinationndmpcopy /home/http /vol/<root volume>/etc/sshd/<username>
ndmpcopy /home/http /vol/<root volume>/etc/sshd/<username>/.ssh
- # Create the text file with
wrfile
and cut and Paste key(s) from your other window, and then ctrl-cwrfile /vol/<root volume>/etc/sshd/<username>/.ssh/authorized_keys
- # if ndmpd was off, turn it off.
ndmpd off
- # ndmpd creates a
restore_symboltable
file. For cleanliness, need to remove that.rm /vol/<root volume>/etc/sshd/<username>/restore_symboltable
rm /vol/<root volume>/etc/sshd/<username>/.ssh/restore_symboltable
Short Cut (if a user has already been setup then their ssh keys and directory structure could be copied which saves some steps).
Warning: Technically, the permissions (unix or Windows ACLs) are going to follow with the ndmpcopy
, so there is a security risk here, if /etc
is NFS mounted or CIFS shared. Keep that in mind.
- # check ndmpd status
ndmpd status
- # if ndmp is not on, turn it on.
ndmpd on
- # When using
ndmpcopy
, the shortcut of dropping/vol/<root volume>
does not work for the destinationndmpcopy /vol/<root volume>/etc/sshd/<exist user with ssh keys>/vol/<root volume>/etc/sshd/<new ssh user>
- # Create the text file with
wrfile
and cut and Paste key(s) from your other window, and then ctrl-cwrfile /vol/<root volume>/etc/sshd/<new ssh username>/.ssh/authorized_keys
- # if ndmpd was off, turn it off.
ndmpd off
- # ndmpd creates a
restore_symboltable
file. For cleanliness, need to remove that.rm /vol/<root volume>/etc/sshd/<new ssh username>/restore_symboltable
Jim – 11/18/13
(I don’t accept general LinkedIn invites – but if you say you read my blog, it will change my mind)
Pingback: NetApp cDOT ssh key config via CLI | I.T. by Crayon
Added a new post for SSH configuration on Clustered Data OnTap (cDOT) at: https://itbycrayon.wordpress.com/2014/09/29/netapp-cdot-ssh-key-config-via-cli/