How to save file on ssh on mac y and enter
![how to save file on ssh on mac y and enter how to save file on ssh on mac y and enter](https://ist.njit.edu/sites/ist/files/macssh3.png)
#Look for ssh config in the default location, pipe to /dev/null to mute output I know it’s a bit comment heavy so please drop anything you don’t need. No will drop the changes and the script will exit. Yes will append the new host to your config file and the script will exit. You’ll be shown the information as it will be written to the config file and asked to confirm. The other three fields will accept any input, including spaces, so be sure the information you input is correct for the field. You shouldn’t have spaces in these names anyway. Spaces in that field will not stop the script, but only the characters before the first space will be picked up as the alias. If you type a name you’ve used already, you’ll be prompted again until you provide a new name. The only error checking in place right now is on the alias (Host) field. Once created, rerunning the script will create a backup copy (which will be useful later on) and then prompt you for input. This script will exit right away if you do not have an ssh config file already.
![how to save file on ssh on mac y and enter how to save file on ssh on mac y and enter](https://asf.alaska.edu/wp-content/uploads/2019/05/EC2-instance-contents.png)
![how to save file on ssh on mac y and enter how to save file on ssh on mac y and enter](https://kinsta.com/wp-content/uploads/2019/12/Finding-Terminal-on-Mac-1-1.jpg)
Now you can can call that script from any directory and add a new host to the config file under /home/youruser/.ssh/. All you need to do is copy the script, save it as yourcommand.sh, set the execute bit with chmod +x yourcommand.sh, and place that file inside of the bin folder in your home directory (which you may have to create). Below is a simple script that automates the addition of new hosts to your ssh config file. I’ve been reading about Bash scripting lately and finally thought of something useful.
#HOW TO SAVE FILE ON SSH ON MAC Y AND ENTER UPDATE#
A simple script to update your ssh config file.