Typically, ITERM2 accesses remote Linux using SSH, as is the case with Termial, as follows:
SSH < user name >@<ip>
Then enter the access password. Of course, there are times when you need to specify access ports.
Ssh-p < port number > < user name >@<ip address >
If the operation under ITerm2 is the same as the termial, what do I do with it?
Of course ITerm2 has its own features, which are used here is the function of profiles.
We write the relevant content of the remote access as a script and then call it in the profile.
The script reads as follows:
#!/usr/bin/expect-f Set User < username > Set host <IP address > Set Password < password > set timeout-1 spawn ssh [em AIL protected] $host expect "*assword:*" send "$password \ r" Interact expect EOF
Save this script and put it in a directory (this can be based on your actual situation, no special)
Next, this is how to invoke the script.
Using SSH to access Linux under ITerm2