Setup SSH connection to Stablehost

112 Likes Comment
SSH Connection on Stablehost

Just follow these steps to setup a SSH connection to your servers on Stablehost.com
1. Purchase a SSH Access ( $2.5 lifetime ) via url: https://billing.stablehost.com/aff.php?aff=4799
2. Install a SSH client ( putty , SecureCRT , Bitvise Tunnelier ).
3. Generate a SSH key via Stabehost Cpanel.
SSH Connection on Stablehost
4. Connect to your shared server / VPS:
IP: your shared IP / dedicated IP
Port: 22
User: cpanel username / Password: cpanel password
5. Some useful commands in SSH:
#create a directory
mkdir folder-name
# download a file from remoted server
scp -P22 [email protected]:/path-to-file-folder/filename.ext .
# backup all mysql databases in separated files
#! /bin/bash
TIMESTAMP=$(date +"%F")
BACKUP_DIR="/backup/$TIMESTAMP"
MYSQL_USER="backup"
MYSQL=/usr/bin/mysql
MYSQL_PASSWORD="password"
MYSQLDUMP=/usr/bin/mysqldump

mkdir -p "$BACKUP_DIR/mysql"

databases=`$MYSQL --user=$MYSQL_USER -p$MYSQL_PASSWORD -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema|performance_schema)"`

for db in $databases; do
$MYSQLDUMP --force --opt --user=$MYSQL_USER -p$MYSQL_PASSWORD --databases $db | gzip > "$BACKUP_DIR/mysql/$db.gz"
done

You might like

Avatar

About the Author: Toc Xoan

Leave a Reply

Your email address will not be published. Required fields are marked *