Skip to content

Instantly share code, notes, and snippets.

View syonfox's full-sized avatar
🎿
living

Kier syonfox

🎿
living
View GitHub Profile
@syonfox
syonfox / lib_ssh_config.sh
Created January 28, 2023 01:10
Managing your SSH config can be a hassle, but with the new lib_ssh_config library, it's never been easier. This powerful library allows you to create, delete, and add hosts to your SSH config file with just a few simple commands. With built-in safety features like automatic backups and user prompts, you can rest easy knowing your data is safe. I…
#!/bin/bash
########################################################################################################################
# This function will check if the ssh config file located at ~/.ssh/config exists. If it does not exist, it will create
# it and write some default content and settings to it. It will also set the correct permissions for the ssh config file
# to be user readable and writable, but not writable by others (700 for the .ssh directory, and 600 for the config file).
# This function can be used to initialize a new ssh config file if one doesn't already exist, or to reset the config file
# to default settings.
########################################################################################################################
#A function to initialize an ssh config file with basic settings and permissions