Skip to content

Instantly share code, notes, and snippets.

@sugumura
Last active June 5, 2019 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sugumura/6d1da4d296be62b39c504a3f2ea67f2b to your computer and use it in GitHub Desktop.
Save sugumura/6d1da4d296be62b39c504a3f2ea67f2b to your computer and use it in GitHub Desktop.
さくらレンタルサーバセットアップ
# login
$ ssh example@example.sakura.ne.jp
$ chsh -s /usr/local/bin/bash
$ exec $SHELL -l
$ cat > ~/.bash_profile <<EOF
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
EOF
$ cat > ~/.bashrc <<EOF
export LANG=ja_JP.UTF-8
alias rm='rm -i'
alias mv='mv -i'
alias ls='ls -G'
export PS1="\e[1;32m\][\u@\h \W]\\$\[\e[m\] "
EOF
$ exec $SHELL -l
$ exit
$ ssh-keygen -t rsa -b 4096 -f ~/.ssh/example.sakura.ne.jp
$ scp ~/.ssh/example.sakura.ne.jp.pub example@example.sakura.ne.jp:~/.ssh/authorized_keys
# login
$ ssh example@example.sakura.ne.jp
$ chmod 600 ~/.ssh/authorized_keys
$ exit
# write access info to ~/.ssh/config
$ ssh example
# composer install
$ mkdir bin
$ curl -sS https://getcomposer.org/installer | php -- --install-dir=./bin
$ mv bin/composer.phar bin/composer
$ composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment