Boto is a rsync-like tool that allows you to upload or download data to DreamObjects. When using boto, you must specify several credentials including your Access Key and Secret Key.
Instead of inputting these credentials into every script you like, an alternative is to create a .boto file in your user's home directory. Then you can reference this file in any script to use your credentials.
Creating a .boto config file
- In your DreamHost panel, navigate to the (Panel > 'CLOUD SERVICES' > 'DreamObjects') page.
- Click your username to view your buckets and keys.
- View the following article for instructions on how to locate your Key pair.
- Copy the key pair to text editor such as Notepad.
- Log into your website via SSH.
- Navigate to your user's home directory.
[server]$ cd $HOME
- Create a file titled .boto (note the leading dot). This file will stores your Keys.
- Take the Access and Secret key pair you copied above and enter them into the .boto file as shown below:
echo [Credentials] >> ~/.boto echo aws_access_key_id = 98F3n8qUtWEJ6ZdBYyQy >> ~/.boto echo aws_secret_access_key = p5kptXKQrsQtTNJTYtG7emGYooXkN6Kaza1OV-_s >> ~/.boto
Using the .boto file in your scripts
Now that the .boto file is created, you can create a connection to DreamObjects using the following:
connection = boto.connect_s3( host='objects-us-west-1.dream.io', )
You only need this single line because the Access and Secret keys are already in the .boto file.