Saving SSH session in Terminal

For Windows users, use PuTTY.

For Mac users, locate to .ssh folder which is under the root folder and create a file named “config” – you can simply use TextEdit.

Note: since .ssh folder is hidden, you can type the below command to view hidden files.

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

In your “config’ file, write and save the server information. Below is just an example. Make sure you follow the below format.

Host abc
    HostName abc-def-123.org.com
    Port 22
    User abc

If you are done modifying your config file, hide your folders by running the below command.

defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder

To connect to the server, relaunch your Terminal and write the below command.

ssh abc

I wanted to create shortcuts to easily connect to servers but if you don’t need to have shortcuts, you can simply open your terminal and click “New Remote Connection” which is located under the “Shell” menu. Click the plus sign and add your server information.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s