Skip to content

SSH

Troubleshooting for common SSH issues

Set the permissions of directories, keys and config file to the following numeric codes using chmod.

ItemSampleNumericBitwise
SSH folder~/.ssh700drwx------
Public key~/.ssh/id_rsa.pub644-rw-r--r--
Private key~/.ssh/id_rsa600-rw-------
Config~/.ssh/config600-rw-------
Home folder~755 at mostdrwxr-xr-x at most

Or simply run:

Terminal window
chmod 700 $HOME/.ssh
chmod 600 $HOME/.ssh/*
chmod 644 $HOME/.ssh/*.pub

When logging into the zervers, you login twice:

  1. Once on the bastion server
  2. and another time to access an internal server (i.e. z011, z012 … z014)

This can be reduced to just one login by setting up SSH key authentication between our client and the internal servers.

On your client machine, run ssh-keygen. Give the identity file pair a custom name (e.g. ‘zervers’). Do not set a passphrase for the key file.

Terminal window
ssh-keygen -t ed25519 -a 100 -f ~/.ssh/zervers
Terminal window
ssh-copy-id -i ~/.ssh/zervers USERNAME@HOSTNAME

This adds your public key to the ~/.ssh/authorized_users file on the remote machine.

On you client machine edit the ssh config file.

Terminal window
vim ~/.ssh/config

Add the following line to the indicated host in your ssh_config file.

Terminal window
Host z010 z011 z012 z013 z014
# previous config options ...
IdentityFile ~/.ssh/zervers

Now when you log in to the zervers, you should only have to login once!

Terminal window
ssh HOSTNAME