Activation of SSH public key with c_AddUser() usage

You can share your Lua Scripts with everybody here.

Activation of SSH public key with c_AddUser() usage

Postby kirikou » Wed Aug 07, 2013 10:14 am

Hello,

I am trying to create an user on Wing FTP Server with c_AddUser(...) trougth API REST , i want that user has an enable and setting SSH public key add.

Here is my command that i launch in ms dos:

curl.exe -s -S -o "C:\TradeXpress5\users\edi\tmp\ESFTP_2" -L -w "%{http_code}\n" -F "admin=kirikou"
-F "pass=armand"
-F "cmd=c_AddUser('TRADEXPREXSS','michael','{tsi}vqOp5XseNhxd7/bLI80',32,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,'c:/temp/Charles.pub',0)" http://192.168.103.112:5466/admin_webservice.html?/

the user is created , but SSH Public key is setting but not enabled ... how can i enable SSH Public Key trough API REST?

Thanks you for you quick response ...
kirikou
 
posts 9
 
joined Wed Aug 07, 2013 9:20 am

Re: Activation of SSH public key with c_AddUser() usage

Postby FTP » Thu Aug 08, 2013 4:45 am

If you want to use public key authentication only, you can use the following Lua script:

Code: Select all
c_AddUser('TRADEXPREXSS','michael','{tsi}vqOp5XseNhxd7/bLI80',32,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,'c:/temp/Charles.pub',0,1,0)
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am

Re: Activation of SSH public key with c_AddUser() usage

Postby kirikou » Thu Aug 08, 2013 9:12 am

Hello FTP, thanks you for your help, it is work.
i had not put the 2 arguments after the c:/temp/Charles.pub argument, in Wing FTP server help there is c_AddUser(....) with 50 arguments, in your post you make c_AddUser(....) with 52 arguments.

So There is a mistake on Wing FTP server help.
THANKS YOU VERY MUCH
Have a good day,
kirikou
 
posts 9
 
joined Wed Aug 07, 2013 9:20 am


Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 1 guest