![](/images/new-backgrounds/1192613/192613143x1.webp)
SSH and SSH Keys
SSH is a network protocol that establishes a secure channel between your computer and a remote computer. It uses
SSH is frequently used to log in to a remote machine to execute commands, but you can also use it to create a secure data tunnel, forwarding through an arbitrary TCP port. You can also use SSH to transfer files using SFTP and SCP. By default, an SSH server uses the standard TCP port 22.
Mac OS X Server uses OpenSSH as the basis for its SSH tools. Notably, portable home directory synchronization is provided via SSH.
Key-Based SSH Login
Important:
Generating a Key Pair for SSH
The following outlines the process of setting up
This doesn’t authorize all users of the computer to have SSH access. Keys must be generated for each user account.
To do this, run the following commands in Terminal:
1Verify that an .ssh folder exists in your home folder by entering the command:
ls
If .ssh is listed in the output, move to step 2. If .ssh is not listed in the output, run mkdir ~/.ssh and continue to step 2.
2Change directories in the shell to the hidden .ssh directory by entering the following command:
cd ~/.ssh
3Generate the public and private keys by entering the following command:
72