Tagged: SSH

Systemd ssh Reverse Tunnel on Debian 9 Stretch

I have used rc.local for years to setup an ssh reverse tunnel on boot under Debian up until Stretch. Now like many others I imagine, I’ve had to convert to systemd. I read everything I could about the choice for deprecating rc.local for systemd. I can say that systemd may be powerful, but systemd’s complexity entails a huge learning-curve for...

Setup SSH for Accessing Remote Server Without Password

On the Remote Server Logged in As User or as root but in users home sudo mkdir ~/.ssh sudo chmod 700 ~/.ssh && chmod 600 ~/.ssh/* On you local (desktop) assuming you have already created your GPG Keys cat ~/.ssh/id_rsa.pub | ssh root@example.com 'cat – >> ~/.ssh/authorized_keys'

Tunnel MySQL Over SSH

Assuming On a “remote.com” server that we will connect to from our LocalMachine 1) MySQL database named “database” 2) MySQL database is running on remote server “remote.com” 3) MySQL is running and listening on (standard) localhost:port “127.0.0.1:3306” 4) MySQL username “mysql_user_name” 5) MySQL password “mysql_password” 6) SSH must be listening on port 9999 7) SSH AllowUsers “ssh_user_name” 8) SSH password...

Start Reverse Tunnel on boot using autossh for Debian 7

As usual, most of the how-to guides out there are too brief (I’m guilty) or apply to other distros: This works on Linux Debian 7 all-around, and this is a complete how to. It works. You just have to follow a very long thread. No A.D.D. here! We will create a Persistent Reverse SSH Tunnel between 2 machines using autossh....

Linux Debian How To Backup System and Data

Command of the Day :: You want to backup a remote machine (server) from a local (desktop) onto the local; type on local/desktop: sudo rsync -azv -e "ssh -i /home/username/.ssh/id_rsa" username@server.seleads.com:/home/username/ /home/username/server_backup_on_local_desktop username@server.seleads.com:/home/username/ (this is the server login and directory being backed up) -i /home/username/.ssh/id_rsa (if you do not want to use password authentication – key is on local/desktop) ——————–...

Install Rsync

Rsync Installation Instuctions sudo apt-get install rsync sudo vi /etc/rsyncd.conf copy into rsyncd.conf motd file = /etc/rsyncd.motd path = /home/username comment = This is the path to folder on the server uid = nobody gid = nobody read only = false auth users = username secrets file = /etc/rsyncd.scrt change username/servername sudo vi /etc/rsyncd.motd any message you want sudo vi...

Create User on Debian

Users and Groups Users are located in /etc/passwd Groups are located in /etc/group The administrative ROOT account is disabled by default in Ubuntu . If you wish to enable the root account, simply give it a password by typing sudo passwd To disable the root account sudo passwd -l root The initial user created by the Ubuntu installer is a...

How to Change or Disable SSH Timeout

On Client sudo vi /etc/ssh/ssh_config add line ServerAliveInterval 100 On Server sudo vi /etc/ssh/sshd_config add lines ClientAliveInterval 30 TCPKeepAlive yes ClientAliveCountMax 99999 From command line per session ssh -o ConnectTimeout=10 ssh -o ConnectTimeout -o BatchMode=yes -o StrictHostKeyChecking=no ServerAliveInterval operates on the ssh layer. It will actually send data through ssh, so the TCP packet has encrypted data in and a...

GPG PGP Keys

Generate an SSH Key pair and upload public key to remote host