-
Open Finder, on the menu bar –> Go –> Go to Folder, type: ~/.ssh/, and press Enter
-
Create a new file, name it, write to it:
Set user Server account set host server IP address set Password Server password spawn SSH $user@$host expect "*assword:*" send "$password\r" interact expect eofCopy the code
-
Open iTerm2, menu bar –>Profiles –>Open Profiles, click Edit Profiles’ in the lower right corner
-
Click +, fill in Nmae, Tags, change Command to Command, and then type: expect ~/.ssh/example