SSH
SSH Keys¶
sshd_config¶
Append these lines to all servers /etc/ssh/sshd_config
Restart SSHD on FreeBSD Restart SSHD on Macsudo launchctl unload /Library/LaunchDaemons/sshd.plist
sudo launchctl load -w /Library/LaunchDaemons/sshd.plist
Generate Keys¶
Open Terminal and enter the following:
To add keys to root you must repeat the process while logged in as root.
You will see these messages. Press Enter without entering anything for all prompts:
Generating public/private rsa key pair.
Enter file in which to save the key (/home/cantin/.ssh/idrsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/cantin/.ssh/idrsa.
Your public key has been saved in /home/cantin/.ssh/id_rsa.pub.
SSH Permissions¶
Fix permissions on .ssh folder:¶
SSH Utility Options¶
SSH Utilities are available in v-util.sh
script.
ssh-port¶
Set SSH port number for the client connecting to other servers.
VNiX network uses port 8649
ssh-copy-id¶
You must login to the other server to allow permissions to transfer the SSH keys to the authorized_keys list of the other {server}.
Google Cloud SSH Keys¶
Copy between Google Servers¶
Create ssh keys for the VM if you haven’t already done so. ssh-keygen -t rsa
Copy the ~/.ssh/id_rsa.pub text into the metadata under compute engine¶
Google Cloud Metadate - SSH Keys
Add key
Paste the contents of id_rsa.pub into the field
Save
Example of the proper way to sync with root permissions and capture all file/directory permissions from source to destination: rsync -axv -e ‘ssh -i /home/vnyx/.ssh/id_rsa -l vnyx’ –rsync-path=’sudo rsync’ mayavilla.srv.vnix.net:/var/www/html/ /var/www/mayavilla.com/html/