mirror of
https://gitlab.waag.org/make/fablab/interns/2025/sam.git
synced 2025-08-03 11:54:58 +00:00
1.5 KiB
1.5 KiB
SSH config files
brief
This is the first time for me using ssh config files so that's why this is a seperate file.
What can you do with ssh config files
In SSH config files you can describe how connections should be handled and with which keys you want to use to log in onto a specific server and much more.
How is a config file structured
Host hostname1
SSH_OPTION value
SSH_OPTION value
Host hostname2
SSH_OPTION value
Host *
SSH_OPTION value
A entry always start with Host
and then the name you wanna give to that host. After that you press enter and then tab. Now you can define the options for the ssh connections.
Example:
HOST gitwaag
Hostname gitlab.waag.org
User git
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
In this config I defined the host as gitwaag. So I can connect to it using the command ssh gitwaag
instead of ssh gitlab.waag.org
.
Explanation of the parameters used in this config above
Hostname
Defines the hostname/domain of the serverUser
The username you wanna log in as on the serverIdentityFile
Which public key you want to use for the connectionIdentitiesOnly
Set it to only use the IdentityFile instead of other authentication files.
For a full list of parameters you can visit https://phoenixnap.com/kb/ssh-config or run man ssh_config
in the terminal.