Vast ai setup bash script. This script is used as a template everytime i rent new gpu from vast ai
ls -al ~/.sshIf you see files like id_rsa or id_ed25519, you may already have a key. You can reuse it or create a new one.
Use the following command (replace with your email):
ssh-keygen -t ed25519 -C "your_email@example.com"- Press
Enterto save to default path (~/.ssh/id_ed25519) or change it any path you want - Optionally enter a passphrase for extra security
eval "$(ssh-agent -s)"Add your private key to the agent:
ssh-add ~/.ssh/id_ed25519Copy your public key:
cat ~/.ssh/id_ed25519.pub- Go to https://cloud.vast.ai/manage-keys/
- Paste the key into the "SSH Keys" field
# Update latest ubuntu packages
apt-get update
apt-get install -y curl git-core
# Install and enable git lfs
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && apt-get install -y git-lfs && git lfs install
# Set up ssh key to connect to github
mkdir -p ~/.ssh && chmod 700 ~/.ssh
cat > ~/.ssh/id_ed25519 <<- EOM
-----BEGIN OPENSSH PRIVATE KEY-----
-----END OPENSSH PRIVATE KEY-----
EOM
chmod 400 ~/.ssh/id_ed25519
ssh-keygen -F github.com || ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.email "your_email@gmail.com"
git config --global user.name "your_name"