Hi all,
I'm trying to create a script that creates users on our filers when necessary and create the appropriate /vol/vol0/etc/sshd/<user>/.ssh/authorized_keys file and so far, I've been able to create the user and create the directories when necessary.
I'm now in the process of trying to create the file authorized_keys using the API call file-write-file* and basically use this function call to create the file and inject / write the keys in to them.
I've been able to figure out that I need to pack the data that I'm trying to write but no matter what I try, I keep getting the error message
file-write-file: Missing input: offset
even though the offset is explicitly given during the following command:
$dst_file = "/vol/vol0/etc/sshd/jmk3/.ssh/authorized_keys";
$packed_string = pack( "H*", $lines[0] );
$offset = -1;
$api_output = $connection->invoke( $api_call, "path", $dst_file, "data", $packed_string, "offset", $offset );
Using this I get the "Missing input: offset" error.
Does anyone know what's going on here?
Kind regards,
Jeroen Kleijer
*) The reason I want to use the API-call file-write-file is that some of our filers have been installed with vol0 being on a NTFS filesystem meaning that I cannot mount them that easily under Linux and write the authorized_keys file. (yes, I can export it using NFS but then I would have to create a mapping where root = Administrator and that was something that I'd hope to avoid. If I can use the API I'd prefer to do that)