Set password instead ssh when python create droplet

Hello I’m trying to create a droplet through api, and i want to set a password instead ssh_keys how can i do this? Thanks!

Example: data = { ‘name’: ‘HelloFromPython’, ‘region’: ‘nyc3’, ‘size’: ‘s-1vcpu-1gb’, ‘image’: ‘ubuntu-20-04-x64’, ‘backups’: ‘False’, ‘ipv6’: ‘True’, ‘password’: ‘MYPASSOWRD’, ‘user_data’: ‘False’, ‘monitoring’: ‘False’, ‘with_droplet_agent’: ‘False’, }

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey there!

Currently it isn’t possible to inject a password through the API when creating a droplet. You can not specify any SSH keys and a droplet will be created and the password for the droplet will be emailed to you.

API Reference

You may want to look into using user data as you could configure a script to create a user with a password using it.

Hope it helps! Nate