PAM Version : 3.0.2
Client Application : /Applications/Local_ssh.app/runiterm.sh <User> <Local IP> <First Port>
======================
Scripts Contents :
#!/bin/bash
MYUSERID="${1}" MYHOST="${2}" MYPORT="${3}"
cat /dev/null > itermssh.script
cat << _EOF_ > itermssh.script
my execCmd("/usr/bin/ssh-keygen -R [${MYHOST}]:${MYPORT}>/dev/null 2>&1;/usr/bin/ssh-keyscan -p ${MYPORT} ${MYHOST} >> ~/.ssh/known_hosts 2>/dev/null;/usr/bin/ssh ${MYUSERID}@${MYHOST} -p ${MYPORT}", 1) on execCmd(cmd, pause)
tell application "iterm2"
create window with default profile
tell current session of current window
write text cmd end tell
end tell
delay pause end execCmd _EOF_
chmod +x itermssh.script
/usr/bin/osascript itermssh.script
=========================
But I have a question.
In this way, two terminals will be generated.
One is a basic MAC terminal,
One is the Iterm terminal
Can I only allow Iterm terminals to occur?