-
-
Notifications
You must be signed in to change notification settings - Fork 842
Closed
Description
When I try to add a new user with curl, the sftpgo returns status code 201 to indicate the user is created successfully.
curl http://127.0.0.1:8080/api/v2/users [email protected] -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ey
JhdWQiOlsiQVBJIl0sImV4cCI6MTY0NTAwMDUzNSwianRpIjoiYzg2YjU5dGE5djhtdXVzcXNwamciLCJuYmYiOjE2NDQ5OTkzMDUsInBlcm1pc3Npb25zIjpbIioiXSwic3ViIjoiNFNTKzBUUVY1
WXlNMGNCNTF4RDRpT25pRDA0VDUyeGc4b1NXYlJoMW1Nbz0iLCJ1c2VybmFtZSI6ImFkbWluIn0.01s6JMT8u4C8RDCMRzSVPKcEfu8CjFaM5E-sh6jeBOM" -v
* Trying 127.0.0.1:8080...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> POST /api/v2/users HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.80.0
> Accept: */*
> Content-Type: json
> Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsiQVBJIl0sImV4cCI6MTY0NTAwMDUzNSwianRpIjoiYzg2YjU5dGE5djhtdXVzcXNwamciLCJuYmYiOjE2NDQ5OTkzMDUsInBlcm1pc3Npb25zIjpbIioiXSwic3ViIjoiNFNTKzBUUVY1WXlNMGNCNTF4RDRpT25pRDA0VDUyeGc4b1NXYlJoMW1Nbz0iLCJ1c2VybmFtZSI6ImFkbWluIn0.01s6JMT8u4C8RDCMRzSVPKcEfu8CjFaM5E-sh6jeBOM
> Content-Length: 1049
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 201 Created
< Content-Type: application/json; charset=utf-8
< Date: Wed, 16 Feb 2022 08:17:51 GMT
< Content-Length: 1094
<
{"id":2,"status":1,"username":"test","email":"[email protected]","expiration_date":0,"public_keys":["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDmGUScLfcdTxr1SS1uGQsJIg23slVgrNZgeaQEKnrGOt9hC1ZQsScgD4HYdHfHyazDb/ltiVI8KawM6CIT5MbW4cNwuHnLZEuV/MncExDLbABijBn45z68sdCgB/6SgeA/bVkk4BJekiUaGwDBxhr6CP0CeZ4pvjzcgNvKHLlg274P+SxLT25/mz7RIveLcO+zciP4mZ+KFoku6Ref+ROdzknUIJE5o8KHZa35OvCXSn4csH/IMT4kqmP662k2DlIUdKPu3M18Nw515aBKaqJIGq/dsrb/UMJtegLxz3G/JQDI8jMLcBxvJooZk5QylqQbzNw8kG2PJEUYeQX1IsHJHy/IvJBnT4JSKhgERx9XdB8uHeCmY2Vh4loe615GSvxI2etmE3kKKIqOHUzdMbFwyg0cAF2HbTkPMNNuMi5b8mQVpvfIpWQKLasD6oxBZ05njclPbaEbcrPsTT9CNRTwTiYbydRPy+7WQ+H8mxTsK1wXzZv/dFT9dpf5ULunQVE= root@0bcc98baf9b9"],"home_dir":"/tmp/test-sftp","uid":0,"gid":0,"max_sessions":0,"quota_size":0,"quota_files":0,"permissions":{"/":["*"]},"created_at":1644999471432,"updated_at":1644999471432,"filters":{"hooks":{"external_auth_disabled":false,"pre_login_disabled":false,"check_password_disabled":false},"totp_config":{"secret":{}}},"filesystem":{"provider":0,"s3config":{},"gcsconfig":{},"azblobconfig":{},"cryptconfig":{},"sftpconfig":{}}}
* Connection #0 to host 127.0.0.1 left intact
the content of add-user.json is:
{
"id": 0,
"status": 1,
"username": "test",
"email": "[email protected]",
"expiration_date": 0,
"home_dir": "/tmp/test-sftp",
"uid": 0,
"gid": 0,
"quota_size": 0,
"max_sessions": 0,
"quota_files": 0,
"upload_bandwidth": 0,
"download_bandwidth": 0,
"additional_info": "",
"permissions": {
"/": [
"*"
]
},
"filesystem": {
"provider": 0
},
"password": "123",
"public_keys": [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDmGUScLfcdTxr1SS1uGQsJIg23slVgrNZgeaQEKnrGOt9hC1ZQsScgD4HYdHfHyazDb/ltiVI8KawM6CIT5MbW4cNwuHnLZEuV/MncExDLbABijBn45z68sdCgB/6SgeA/bVkk4BJekiUaGwDBxhr6CP0CeZ4pvjzcgNvKHLlg274P+SxLT25/mz7RIveLcO+zciP4mZ+KFoku6Ref+ROdzknUIJE5o8KHZa35OvCXSn4csH/IMT4kqmP662k2DlIUdKPu3M18Nw515aBKaqJIGq/dsrb/UMJtegLxz3G/JQDI8jMLcBxvJooZk5QylqQbzNw8kG2PJEUYeQX1IsHJHy/IvJBnT4JSKhgERx9XdB8uHeCmY2Vh4loe615GSvxI2etmE3kKKIqOHUzdMbFwyg0cAF2HbTkPMNNuMi5b8mQVpvfIpWQKLasD6oxBZ05njclPbaEbcrPsTT9CNRTwTiYbydRPy+7WQ+H8mxTsK1wXzZv/dFT9dpf5ULunQVE= root@0bcc98baf9b9"
]
}
I can login to the sftp server with user/password(test/123).But when I try to use private key to login to the sftp server, it prompts me to input the password.
Can you help me to find what's wrong with above json body?
Thanks in advance!
Metadata
Metadata
Assignees
Labels
No labels