Skip to content

thunderrabbit/new-DH-user-account

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

New Dreamhost user account

This essentially spells out the tasks I do each time I set up a new user with shell access on Dreamhost.

It sets up git, emacs, and passwordless authentication, then essentially disables password logins by creating a random 432 character password and helpfully forgetting it.

In the steps below, replace example.com with your new domain.

Set up the new domain

From Dreamhost Control Panel -> Domains -> Manage Domains -> Add Hosting to a Domain / Sub-domain

Fill in the blanks, including create a new user.

Make note of the password created by Dreamhost. We will need it where PASSWORD is written below.

Give shell access to the user

Make sure the new user is a shell user at https://panel.dreamhost.com/index.cgi?tree=users.users

On local machine, create a new ssh key

cd ~/.ssh
ssh-keygen

Enter example.com as the key filename

On local machine, set up ~/.ssh/config

Append something like the following to ~/.ssh/config:

Host example
    HostName example.com
    User example_user
    IdentityFile ~/.ssh/example.com
    IdentitiesOnly yes

scp the public key to the new account using PASSWORD:

scp ~/.ssh/example.com.pub example:authorized_keys

ssh to the new account using PASSWORD:

ssh example

While on the new account, clone this repo:

git clone https://github.com/thunderrabbit/new-DH-user-account.git

Set up the account with passwordless entry

cd new-DH-user-account
./setup.sh
exit

On local machine, ssh to the new account without password

ssh example

It's very very important you log in without password here!

Basically destroy password logins

cd ~/new-DH-user-account
./password_fix.sh

Enter the short PASSWORD created by Dreamhost when requested

Now your password is 432 random characters.
It can be reset in control panel (to a measly 31 characters) but the point is to never use passwords to log in.

If everything worked, then cleanup

cd ~
~/new-DH-user-account/cleanup.sh

Optional: create key for new server to ssh out

cd ~
ssh-keygen

Optional: Add key to something:

cat ~/.ssh/id_rsa.pub

Optional: Install Composer

https://getcomposer.org/download/

cd ~
mv composer.phar .php/composer
echo '' >> ~/.bash_profile
echo '# allow run composer' >> ~/.bash_profile
echo 'PATH=$PATH:~/.php/' >> ~/.bash_profile

Optional: update this repo

emacs ~/new-DH-user-account/.git/config
url = [email protected]:thunderrabbit/new-DH-user-account.git

About

This helps me set up new users on Dreamhost

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages