How to login with newly created user? I tried copying the ssh keys that I got in response to create-user req above in a file (key) and log in using ssh -i key mvo@<ip address>. But could not. I tried with all the (4) ssh keys that I got in response above. The keys looks very different to what I usually seen.
How to delete the user created above? Tried sudo userdel mvo but it failed saying userdel: cannot remove entry 'mvo' from /etc/passwd On checking, I see that user mvo in not there in /etc/passwd at all. But getent passwd shows it !!
ubuntu core does not usr /etc/passwd to create users, but /var/lib/extrausers/passwd so you need to tell userdel to use this database by passing it the right options …
Although the userdel command succeeded, recreation of user again failed with error ‘device already managed’. Looks like the command does not cleanly delete the user.
Worked.
What is the corresponding snapctl API to do this? I tried: sudo curl -sS --unix-socket /run/snapd.socket http://localhost/v2/remove-user -X POST -d '{"email": "mvo@ubuntu.com"}'
but failed.
Also, logging in with the ssk keys is still not possible. I am unable to determine whether I have single ssh key or multiple. Anyway I tried all of them but I get Load key "key": invalid format on doing ssh -i key mvo@<ip address>
I’d suggest reading up about how ssh key authentication works…
And then I’d stop using someone else’s user credentials… what do you try to achieve by using Michaels account data on your device? You do not own the secret key for it…
I was able to login using the user created by create-user API. Had to register my public key with Ubuntu account (which I had not done before)
Have few questions though
Why the does o/p of create-user gives out public key of user? Private key is required to login to the device? So I am not sure what value giving out the public key adds. Am I missing something?
Although snap remove-user works from command line, still looking for API equivalent of remove user. I tried delete-user and remove-user using curl from command line, but get {"message":"not found"} as response.