Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

SSH Tunnel

All examples are included with download of MBS FileMaker Plugin.

SSH Tunnel.fmp12

Overview
Tables 1
Relationships 0
Layouts 1
Scripts 5
Value Lists 0
Custom Functions 0
Custom Menus 33
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Visionär
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password On
Require iOS passcode Off
Show Sign-in fields Off
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Comments
Occurrences in Relationship Graph
SSH
12 fields defined, 3 records
SSH

Fields

Table Name: SSH - 12 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
Host Normal, Text Auto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
  • Index Language: German
      Port Normal, Text Auto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Global
      • Repetitions: 1
      • Index Language: German
          Username Normal, Text Auto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Global
          • Repetitions: 1
          • Index Language: German
              Password Normal, Text Auto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Global
              • Repetitions: 1
              • Index Language: German
                  Result Normal, Text Auto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      Messages Normal, Text Auto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                          HostKeyHash Normal, Text Auto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                              UserAuthList Normal, Text Auto-Enter:
                              • Allow editing
                              Validation:
                              • Only during data entry
                              Storage:
                              • Repetitions: 1
                              • Indexing: None
                              • Automatically create indexes as needed
                              • Index Language: German
                                  RemoteHost Normal, Text Auto-Enter:
                                  • Allow editing
                                  Validation:
                                  • Only during data entry
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                      RemotePort Normal, Number Auto-Enter:
                                      • Allow editing
                                      Validation:
                                      • Only during data entry
                                      Storage:
                                      • Repetitions: 1
                                      • Indexing: None
                                      • Automatically create indexes as needed
                                      • Index Language: German
                                          LocalHost Normal, Text Auto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: German
                                              LocalIP Normal, Number Auto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: German

                                                  Layout Objects: SSH

                                                  Regular Fields

                                                  Field Name: SSH::Host
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 7 pt
                                                  • Left: 138 pt
                                                  • Bottom: 28 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  No

                                                  Field Name: SSH::Port
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 34 pt
                                                  • Left: 138 pt
                                                  • Bottom: 55 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  No

                                                  Field Name: SSH::Username
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 61 pt
                                                  • Left: 138 pt
                                                  • Bottom: 82 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  No

                                                  Field Name: SSH::Password
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 88 pt
                                                  • Left: 138 pt
                                                  • Bottom: 109 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  No

                                                  Field Name: SSH::Result
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 177 pt
                                                  • Left: 138 pt
                                                  • Bottom: 198 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: SSH::Messages
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 205 pt
                                                  • Left: 138 pt
                                                  • Bottom: 411 pt
                                                  • Right: 595 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: SSH::HostKeyHash
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 425 pt
                                                  • Left: 138 pt
                                                  • Bottom: 446 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: SSH::UserAuthList
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 452 pt
                                                  • Left: 138 pt
                                                  • Bottom: 473 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: SSH::RemoteHost
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 115 pt
                                                  • Left: 138 pt
                                                  • Bottom: 137 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: Default for Data Type
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: SSH::RemotePort
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 115 pt
                                                  • Left: 402 pt
                                                  • Bottom: 137 pt
                                                  • Right: 481 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: Default for Data Type
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: SSH::LocalHost
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 143 pt
                                                  • Left: 138 pt
                                                  • Bottom: 165 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: Default for Data Type
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: SSH::LocalIP
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 143 pt
                                                  • Left: 402 pt
                                                  • Bottom: 165 pt
                                                  • Right: 481 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: Default for Data Type
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Buttons

                                                  Button Properties Coordinates Script/Script Step
                                                    Type:
                                                  • Text: Connect and start Tunnel
                                                  • Top: 17 pt
                                                  • Left: 534 pt
                                                  • Bottom: 46 pt
                                                  • Right: 697 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Start Tunnel” ]

                                                  Scripts:


                                                  Button Properties Coordinates Script/Script Step
                                                    Type:
                                                  • Text: Close Tunnel
                                                  • Top: 53 pt
                                                  • Left: 534 pt
                                                  • Bottom: 82 pt
                                                  • Right: 697 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Close SSH” ]

                                                  Scripts:


                                                  Button Properties Coordinates Script/Script Step
                                                    Type:
                                                  • Text: Update Messages
                                                  • Top: 89 pt
                                                  • Left: 534 pt
                                                  • Bottom: 118 pt
                                                  • Right: 697 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Update Messages” ]

                                                  Scripts:


                                                  Script Hierarchy

                                                  Init SSH
                                                  Start Tunnel
                                                  Update Messages
                                                  Close SSH
                                                  Clear

                                                  Next Script: [Start Tunnel]
                                                  Script Name Init SSH
                                                  Run script with full access privileges Off
                                                  Siri Shortcut Visible Off
                                                  Include In Menu Yes
                                                  Layouts that use this script
                                                    Scripts that use this script
                                                    Script Definition
                                                    Script Steps
                                                    • If [ Length ( $$ssh ) > 0 ]
                                                    • Perform Script [ “Close SSH” ]
                                                    • End If
                                                    • # Start a new SSH session
                                                    • Set Variable [ $ssh; Value:MBS( "SSH.New" ) ]
                                                    • # Connect to an IP
                                                    • Set Variable [ $r; Value:MBS( "SSH.Connect"; $ssh; SSH::Host; SSH::Port ) ]
                                                    • If [ MBS("IsError") ]
                                                    • Show Custom Dialog [ Title: "Connect error"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                    • Set Field [ SSH::Result; $r ]
                                                    • Else [ ]
                                                    • # Run the session handshake.
                                                    • Set Variable [ $r; Value:MBS( "SSH.SessionHandshake"; $ssh) ]
                                                    • If [ MBS("IsError") ]
                                                    • Show Custom Dialog [ Title: "Connect error"; Message: $r; Default Button: “OK”, Commit: “No”; Button 2: “Cancel”, Commit: “No” ]
                                                    • Set Field [ SSH::Result; $r ]
                                                    • Else [ ]
                                                    • # We can show the hostkey. You can compare it to known hostkey.
                                                    • Set Field [ SSH::HostKeyHash; MBS( "SSH.HostKey"; $ssh ) ]
                                                    • # We query supported authentication ways
                                                    • Set Variable [ $authuserlist; Value:MBS( "SSH.userauthlist"; $ssh; SSH::Username) ]
                                                    • Set Field [ SSH::UserAuthList; $authuserlist ]
                                                    • Set Variable [ $pos1; Value:Position ( $authuserlist ; "password"; 1; 1 ) ]
                                                    • Set Variable [ $pos2; Value:Position ( $authuserlist ; "keyboard-interactive"; 1; 1 ) ]
                                                    • Set Variable [ $pos3; Value:Position ( $authuserlist ; "publickey"; 1; 1 ) ]
                                                    • If [ $pos1 > 0 ]
                                                    • # Authenticate with password
                                                    • Set Variable [ $r; Value:MBS( "SSH.UserAuthPassword"; $ssh; SSH::Username; SSH::Password ) ]
                                                    • If [ MBS("IsError") ]
                                                    • Show Custom Dialog [ Title: "Connect error"; Message: $r; Default Button: “OK”, Commit: “No”; Button 2: “Cancel”, Commit: “No” ]
                                                    • End If
                                                    • Set Field [ SSH::Result; $r ]
                                                    • Else If [ $pos2 > 0 ]
                                                    • # Authenticate with answering question. Plugin passes password for answer.
                                                    • Set Variable [ $r; Value:MBS( "SSH.UserAuthKeyboardInteractive"; $ssh; SSH::Username; SSH::Password ) ]
                                                    • If [ MBS("IsError") ]
                                                    • Show Custom Dialog [ Title: "Connect error"; Message: $r; Default Button: “OK”, Commit: “No”; Button 2: “Cancel”, Commit: “No” ]
                                                    • End If
                                                    • Set Field [ SSH::Result; $r ]
                                                    • Else If [ $pos3 > 0 ]
                                                    • # Authenticate with public key file
                                                    • Set Variable [ $r; Value:MBS( "SSH.UserAuthPublicKey"; $ssh; SSH::Username; "your key path"; "your key path"; SSH::Password ) ]
                                                    • If [ MBS("IsError") ]
                                                    • Show Custom Dialog [ Title: "Connect error"; Message: $r; Default Button: “OK”, Commit: “No”; Button 2: “Cancel”, Commit: “No” ]
                                                    • End If
                                                    • Set Field [ SSH::Result; $r ]
                                                    • End If
                                                    • If [ MBS( "SSH.IsAuthenticated"; $ssh ) ≠ 1 ]
                                                    • Show Custom Dialog [ Title: "Authentication"; Message: "no authenticated. Supported ways: " & $authuserlist; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                    • Else [ ]
                                                    • # Keep connection
                                                    • Set Variable [ $$ssh; Value:$ssh ]
                                                    • Exit Script [ Result: "OK" ]
                                                    • End If
                                                    • End If
                                                    • End If
                                                    Fields used in this script
                                                    Scripts used in this script
                                                    Layouts used in this script
                                                      Tables used in this script
                                                      Table occurrences used by this script
                                                      Custom Functions used by this script
                                                        Custom menu set used by this script

                                                          Previous Script: [Init SSH] Next Script: [Update Messages]
                                                          Script Name Start Tunnel
                                                          Run script with full access privileges Off
                                                          Siri Shortcut Visible Off
                                                          Include In Menu Yes
                                                          Layouts that use this script
                                                          Scripts that use this script
                                                            Script Definition
                                                            Script Steps
                                                            • Perform Script [ “Init SSH” ]
                                                            • If [ Length ( $$ssh ) > 0 ]
                                                            • Set Variable [ $r; Value:MBS( "SSH.Tunnel.Run"; $$ssh; SSH::RemoteHost; SSH::RemotePort; SSH::LocalHost; SSH::LocalIP ) ]
                                                            • Set Field [ SSH::Result; $r ]
                                                            • Set Field [ SSH::Messages; MBS( "SSH.Tunnel.Messages"; $$ssh ) ]
                                                            • End If
                                                            Fields used in this script
                                                            Scripts used in this script
                                                            Layouts used in this script
                                                              Tables used in this script
                                                              Table occurrences used by this script
                                                              Custom Functions used by this script
                                                                Custom menu set used by this script

                                                                  Previous Script: [Start Tunnel] Next Script: [Close SSH]
                                                                  Script Name Update Messages
                                                                  Run script with full access privileges Off
                                                                  Siri Shortcut Visible Off
                                                                  Include In Menu Yes
                                                                  Layouts that use this script
                                                                  Scripts that use this script
                                                                    Script Definition
                                                                    Script Steps
                                                                    Fields used in this script
                                                                    Scripts used in this script
                                                                      Layouts used in this script
                                                                        Tables used in this script
                                                                        Table occurrences used by this script
                                                                        Custom Functions used by this script
                                                                          Custom menu set used by this script

                                                                            Previous Script: [Update Messages] Next Script: [Clear]
                                                                            Script Name Close SSH
                                                                            Run script with full access privileges Off
                                                                            Siri Shortcut Visible Off
                                                                            Include In Menu Yes
                                                                            Layouts that use this script
                                                                            Scripts that use this script
                                                                            Script Definition
                                                                            Script Steps
                                                                            • If [ Length($$SSH) > 0 ]
                                                                            • # Stop tunneel
                                                                            • Set Variable [ $r; Value:MBS( "SSH.Tunnel.Cancel"; $$ssh ) ]
                                                                            • Pause/Resume Script [ Duration (seconds): ,1 ]
                                                                            • # Disconnect
                                                                            • Set Variable [ $r; Value:MBS( "SSH.Disconnect"; $$ssh ) ]
                                                                            • # Release memory.
                                                                            • Set Variable [ $r; Value:MBS( "SSH.Release"; $$ssh ) ]
                                                                            • End If
                                                                            Fields used in this script
                                                                              Scripts used in this script
                                                                                Layouts used in this script
                                                                                  Tables used in this script
                                                                                    Table occurrences used by this script
                                                                                      Custom Functions used by this script
                                                                                        Custom menu set used by this script

                                                                                          Previous Script: [Close SSH]
                                                                                          Script Name Clear
                                                                                          Run script with full access privileges Off
                                                                                          Siri Shortcut Visible Off
                                                                                          Include In Menu Yes
                                                                                          Layouts that use this script
                                                                                            Scripts that use this script
                                                                                              Script Definition
                                                                                              Script Steps
                                                                                              • Go to Record/Request/Page [ First ]
                                                                                              • Loop [ Flush: Always ]
                                                                                              • Set Field [ SSH::HostKeyHash; "" ]
                                                                                              • Set Field [ SSH::UserAuthList; "" ]
                                                                                              • Set Field [ SSH::Messages; "" ]
                                                                                              • Go to Record/Request/Page [ Next; Exit after last ]
                                                                                              • End Loop
                                                                                              • Go to Record/Request/Page [ First ]
                                                                                              Fields used in this script
                                                                                              Scripts used in this script
                                                                                                Layouts used in this script
                                                                                                  Tables used in this script
                                                                                                  Table occurrences used by this script
                                                                                                  Custom Functions used by this script
                                                                                                    Custom menu set used by this script

                                                                                                      Download example: SSH Tunnel

                                                                                                      Used functions: