When connecting to dev.example.test, automatically use login user trainee in the SSH client configuration.
Which configuration is appropriate?
ssh_config uses a Host block to select a destination and User to set its login name.
Detailed explanation
Match dev.example.test
Login traineeIncorrect. Server and Account are not the relevant OpenSSH client keywords.
Server dev.example.test
Account traineeCorrect. The Host block's User sets the login name.
Host dev.example.test
User traineeIncorrect. The standard keyword is User, not Login.
HostName trainee
User dev.example.testIncorrect. It swaps hostname and user semantics.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' 'Host dev.example.test' ' User trainee'Expected result
Host dev.example.test
User traineeKey points
- Host selects a target
- User selects login name
- ssh_config is client-side
Notes
- Environment: OpenSSH client設定の構文確認
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Host key
A server identity key used by SSH clients to detect a changed endpoint.
User key
A key pair used to authenticate a user to an SSH server.
Port forwarding
An SSH tunnel that carries traffic between a local, remote, or dynamic endpoint.