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.
Incorrect. 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.
Correct. The Host block's User sets the login name.
Host dev.example.test
User traineeIncorrect. The standard keyword is User, not Login.
Incorrect. The standard keyword is User, not Login.
HostName trainee
User dev.example.testIncorrect. It swaps hostname and user semantics.
Incorrect. 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
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.