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.
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.
Make sure the new user is a shell user at https://panel.dreamhost.com/index.cgi?tree=users.users
cd ~/.ssh
ssh-keygen
Enter example.com
as the key filename
Append something like the following to ~/.ssh/config
:
Host example
HostName example.com
User example_user
IdentityFile ~/.ssh/example.com
IdentitiesOnly yes
scp ~/.ssh/example.com.pub example:authorized_keys
ssh example
git clone https://github.com/thunderrabbit/new-DH-user-account.git
cd new-DH-user-account
./setup.sh
exit
ssh example
It's very very important you log in without password here!
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.
cd ~
~/new-DH-user-account/cleanup.sh
cd ~
ssh-keygen
cat ~/.ssh/id_rsa.pub
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
emacs ~/new-DH-user-account/.git/config
url = [email protected]:thunderrabbit/new-DH-user-account.git