TTSSH command line
You can use the following command line parameters for SSH connections (TTSSH). SSH in Tera Term Mac is the macOS ssh command (OpenSSH). For how to start the app, see "Tera Term Mac command line".
These options also work in the host field of the New connection dialog and with the connect macro command.
Port forwarding and X11 forwarding are set in [Setup]-[SSH Forwarding...]; agent forwarding and compression in [Setup]-[SSH...].
Options
- <username>@<host>[:<#TCP port>]
- A user can specify the user name in front of at-mark.
- <scheme>://[<username>[:<password>]@]<host>[:<TCP port>][/]
- The URL format is extended.
<scheme> can be ssh, ssh2, slogin or slogin2.
When the port number is omitted, 22 is used.
Works as a command line argument (for exampleopen -a "Tera Term Mac" --args ssh://user@host). Tera Term Mac is not registered as the handler of ssh:// URLs. A password in the URL is not used on the startup command line (it works with the connect macro command). - /t=<value>
- value=2 enable SSH
- other values disable SSH
- /nossh
- Disable SSH
- /telnet
- Disable SSH
and use the Telnet protocol. Same as /T=1 of Tera Term. - /2
- Connect with SSH2
- /ssh2
- Connect with SSH2
- /auth=<mode>
- Try auto login with the authentication method given by <mode>
- password password authentication
- publickey public key authentication
- challenge keyboard-interactive authentication
- keyboard-interactive same as challenge
- pageant public key authentication with an agent (ssh-agent)
- /user=<username>
- Specify the user name
- /passwd=<password>
-
Specify the password
Works with the connect macro command. Not used on the startup command line. With /auth=publickey it is used as the key passphrase.
See Notes on Specifying a Password. - /keyfile=<file>
-
Specify the private key
Passed to ssh -i. Give an absolute path or a path starting with ~. Use an OpenSSH private key (PuTTY .ppk files cannot be used). - /ask4passwd
-
Ask for the password instead of logging in automatically
/auth=<mode> then only means the authentication method.
Works with the connect macro command.
To include spaces or semicolons in a parameter value, enclose the whole value in `"'.
To include `"' in a value, write two `"' characters ("").
Example
open -a "Tera Term Mac" --args server1 open -a "Tera Term Mac" --args server1:22 /ssh /user=guest open -a "Tera Term Mac" --args guest@server2 open -a "Tera Term Mac" --args ssh://guest@server3:2222/ open -a "Tera Term Mac" --args server4 /ssh /user=admin /keyfile=~/.ssh/id_ed25519
Examples of the connect macro command:
connect 'server3:22 /ssh /2 /auth=password /user=guest /passwd=guest' connect 'server4:22 /ssh /2 /auth=publickey /user=admin /keyfile=~/.ssh/id_ed25519 /ask4passwd'
Notes on Specifying a Password
A password written in command line arguments can be seen in the arguments of the running process (with the ps command and so on). In Tera Term Mac:
- Run with command line arguments
- /passwd= and a password in the URL are not used on the startup command line. Do not put passwords on the command line.
- Specify an argument of the connect macro command
-
connect is handled inside the same process and does not start a new process. The password is not passed as an ssh argument; it is typed in when ssh asks for it.
Instead of writing the password in the macro file, you can also use getpassword and similar commands. - [File]-[Duplicate session] and TeraTerm Menu
- Neither starts a new process, so no password is passed in command line arguments.
Example: using an agent
The agent is the macOS ssh-agent. Add your key to ssh-agent first (the passphrase can also be stored in the macOS keychain).
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
To connect from Tera Term Mac with public key authentication through the agent:
connect 'shell.example.com:22 /ssh /auth=pageant /user=yutaka'