Beruflich Dokumente
Kultur Dokumente
ACHTUNG
Der SSH-Konfigurationsdienst darf ausschließlich durch qualifiziertes Personal genutzt werden.
Dieses Dokument beschreibt einen möglichen Mechanismus für die Fern-Konfiguration und das Fern-Update eines
SIMATIC Thin Client mit SSH. Alle aufgeführten SSH-Befehle sind Linux-Befehle.
Einleitung
Als sicherer Telnet-Ersatz bietet SSH drei wichtige Eigenschaften:
● Authentifizierung der Gegenstelle
● Verschlüsselung der Datenübertragung einschließlich der Anmeldeinformationen
● Datenintegrität, d. h. Schutz vor Manipulation der Übertragung.
Voraussetzungen
Folgende Voraussetzungen müssen zur Fern-Konfiguration und zum Fern-Update eines Thin Client erfüllt sein:
● Der Thin Client befindet sich in einem TCP/IP-Netzwerk und ist über eine IP-Adresse von einem SSH-Client, z. B. Server
oder PC, ansprechbar.
● Auf dem Thin Client läuft ein SSH-Server, der über den Standard-Port 22 erreichbar ist.
● Standardprogramme, die das SSH-Protokoll unterstützen, sind auf dem Server oder PC installiert, z. B. OpenSSH,
WinSsh oder WinSCP.
● In den Beispielen ist die verwendete IP-Adresse "192.168.11.229" durch die IP-Adresse Ihres Thin Client zu ersetzen.
Allgemeine Informationen
● Zum automatisierten Konfigurieren von mehreren Thin Clients kann zum Beispiel die Umgebung "cygwin
(www.cygwin.com)" verwendet werden.
● Die Beispiele in diesem Dokument gelten für das Betriebssystem "Linux".
● Der Benutzername des Thin Client lautet immer "tc".
ACHTUNG
Erste Anmeldung
Bei der ersten Anmeldung erhalten Sie folgende Meldung:
The authenticity of host ‘<IP-Adresse>’ can’t be established…Are you sure you want to continue connecting (yes/no)?
Bestätigen Sie diese Meldung mit "yes ". Die IP-Adresse wird zur Liste der bekannten Hosts hinzugefügt.
© Siemens Ⓟ2010
A5E02477565-02, 03/2010 1
Authentifizierung
Übersicht Sicherheitsmechanismen
Übersicht
SSH bietet drei Sicherheitsmechanismen:
● Authentifizierung der Gegenstelle
● Verschlüsselung der Datenübertragung einschließlich der Anmelde-Informationen
● Datenintegrität, d. h. Schutz vor Manipulation der Übertragung.
ACHTUNG
SSH-Kennwort
Die Authentifizierung mit SSH-Kennwort wird nicht mehr unterstützt. Verwenden Sie statt dessen eine Schlüsseldatei.
Bei der asymmetrischen Verschlüsselung wird ein Schlüsselpaar erzeugt, das mathematisch durch
Verschlüsselungsalgorithmen wie RSA oder DSA voneinander abhängt. Was mit dem einen Schlüssel verschlüsselt wird,
kann nur durch den anderen Schlüssel wieder entschlüsselt werden. Dadurch kann einer der beiden Schlüssel öffentlich zur
Verfügung gestellt werden, um Sendungen zu verschlüsseln. Die Sendungen können dann nur mit dem anderen Schlüssel,
der privat und unzugänglich ist, entschlüsseln werden.
Im Gegenzug kann ein Datenpaket auch mit dem eigenen privaten Schlüssel verschlüsselt werden. Wenn dieser
verschlüsselte Text sich dann mit dem öffentlichen Schlüssel wieder entschlüsseln lässt, ist sichergestellt, dass das
Datenpaket ausschließlich vom Besitzer des privaten Schlüssels kommt (digitale Signatur).
VORSICHT
Gefahr des Datenmißbrauchs
Die private Standard-Schlüsseldatei ist für jedes Gerät gleich. Benutzen Sie die Standard-Schlüsseldatei, um damit ein
neues Schlüsselpaar zu erzeugen. Verwenden Sie dann nur das neue Schlüsselpaar.
Vorgehensweise
Um den privaten Standard-Schlüssel zu installieren, gehen Sie wie folgt vor:
1. Laden Sie die Datei, die Sie vom "Technical Support (http://support.automation.siemens.com)" erhalten haben, auf Ihren
PC herunter.
2. Legen Sie die Datei als "id_rsa" ohne Dateieendung in dem Verzeichnis ab, in dem sich SSH oder Tools zum Erzeugen
eines Schlüsselpaars z. B. "ssh-keygen" befinden.
3. Geben Sie in der Kommandozeile bei jedem Befehl den Schalter -i id_rsa an.
Der Inhalt der Datei "id_rsa" wird als privater Schlüssel zum Thin Client übertragen. Weitere Informationen entnehmen Sie
der Dokumentation zu den genannten Tools.
Voraussetzung
Die folgenden Schlüsseldateien sind verfügbar:
● Die private Schlüsseldatei "id_rsa" z. B. lokal auf dem PC.
● Eine dazu passende "öffentliche" Schlüsseldatei z. B. "id_rsa.pub" auf dem Thin Client.
Vorgehensweise
Um ein neues Schlüsselpaar zu erzeugen z. B. mit "ssh-keygen", gehen Sie wie folgt vor:
1. Geben Sie folgenden Befehl ein:
ssh-keygen -t rsa -b 1024 -f id_rsa
Im Verzeichnis wird ein Schlüssel vom Typ "rsa" der Länge 1024 Bit unter dem Namen "id_rsa" erstellt.
2. Lassen Sie die anschließend angeforderte "Passphrase" leer, indem Sie zweimal <Enter> eingeben.
Das Schlüsselpaar wird erzeugt.
3. Um den erzeugten öffentlichen Schlüssel auf den Thin Client zu übertragen, geben Sie folgenden Befehl ein:
scp -i id_rsa id_rsa.pub tc@192.168.11.229:/key/id_rsa.pub
Der neue öffentliche Schlüssel muss im Verzeichnis "/key" unter dem Namen "id_rsa.pub" abgelegt werden.
4. Um den Schlüssel auf dem Thin Client zu aktivieren, geben Sie folgenden Befehl ein:
ssh -i id_rsa tc@192.168.11.229 putkey
Der neue öffentliche Schlüssel ist auf dem Thin Client installiert. Mit dem neuen privaten Schlüssel führen Sie in den
nachfolgenden Abschnitten gesicherte "ssh"- und "scp"-Befehle aus, z. B. scp -i id_rsa ...
ACHTUNG
SSH-Kennwort
Die Authentifizierung mit SSH-Kennwort wird nicht mehr unterstützt. Verwenden Sie statt dessen eine Schlüsseldatei.
Voraussetzung
Die folgenden Schlüsseldateien sind verfügbar:
● Die private Schlüsseldatei "id_rsa" z. B. lokal auf dem PC.
● Eine dazu passende "öffentliche" Schlüsseldatei z. B. "id_rsa.pub" auf dem Thin Client.
Weitere Informationen siehe Kapitel "Authentifizierung (Seite 2)".
Vorgehensweise
Um die neue Konfigurationsdatei einzuspielen, gehen Sie wie folgt vor:
1. Geben Sie folgenden Befehl ein:
scp –i id_rsa thinclient.cfg tc@192.168.11.229:/conf/thinclient.cfg.restore
● Übernehmen Sie die Konfigurationsdatei mit folgendem Befehl auf den Thin Client:
ssh –i id_rsa tc@192.168.11.229 restore
Der Thin Client wird automatisch heruntergefahren und neu gestartet. Die eingespielte Konfiguration ist gültig.
Firmware aktualisieren
Einleitung
Um ein Fern-Update eines Thin Client durchzuführen, laden Sie die Update-Datei mit der neuen der Firmware auf den
Thin Client und starten den Update-Prozess. Dazu geben Sie in der Kommandozeile die private Schlüsseldatei an.
ACHTUNG
Die Update-Datei muss auf dem Thin Client in ein Verzeichnis "/update/fw_update" abgelegt werden. Der Name der
Update-Datei ist frei wählbar.
Vorgehensweise
1. Übertragen Sie die Update-Datei mit folgendem Befehl auf den Thin Client:
scp –i id_rsa FWupdateDateiTC.upd tc@192.168.11.229:/update/fw_update
Ersetzen Sie dabei "FWupdateDateiTC" durch den Namen Ihrer Update-Datei.
2. Stoßen Sie den Update-Prozess auf dem Thin Client mit folgendem Befehl an:
ssh –i id_rsa tc@192.168.11.229 update
Der Thin Client wird automatisch heruntergefahren und neu gestartet. Die eingespielte Firmware ist gültig.
Siehe auch
Neues Schlüsselpaar erzeugen (Seite 3)
ACHTUNG
Das Hintergrundbild muss auf dem Thin Client in ein Verzeichnis "/backgr/backgroundPic.png" abgelegt werden. Der Name
des Hintergrundbildes ist frei wählbar.
Vorgehensweise
ACHTUNG
Hintergrundbild unwiederruflich gelöscht
Das aktuelle Hintergrundbild wird gelöscht und kann nicht wiederhergestellt werden. Sie können jedoch das SIMATIC-
Hintergrundbild von den Service&Support-Seiten downloaden.
1. Um das Hintergrundbild "myBackgrPic.png" auf den Thin Client zu übertragen, geben Sie folgenden Befehl ein:
scp –i id_rsa myBackgrPic.png tc@192.168.11.229:/backgr/backgroundPic.png
2. Um das übertragene Hintergrundbild auf dem Thin Client zu aktivieren, geben Sie folgenden Befehl ein:
ssh –i id_rsa tc@192.168.11.229 setbackgr
Siehe auch
Neues Schlüsselpaar erzeugen (Seite 3)
Hinweis
Wenn in der Konfigurationsdatei fehlerhafte Werte vorhanden sind, werden die entsprechenden Werte in der
Konfigurationsdatei auf dem Thin Client nicht überschrieben, sondern beibehalten. In diesem Falle werden Warnungen
passend zu den entsprechenden Variablen zurückgegeben, die in HTML Tags eingeschlossen sind. Der Restore-Prozess
wird dennoch ausgeführt.
Beispiel:
Following values are not updated because of errors:
<tr><td height="10" width="64"></td></tr><tr><td width="64"></td><td>Warning: the new value
"192.168." of variable NET_IP_ADDRESS is not valid!</td></tr> <tr><td
width="64"></td><td><b>RESTORE OK!</b></td></tr>
Restore continued.
OK: Restoring of Thin Client was successful.
The Thin Client is now rebooting!
System-Rückgabewerte:
0 = OK
Bei Fehlermeldungen: Fehlernummer
Rückgaben auf Stdout (Linux) des SSH-Client beim Ausführen der Übernahme der öffentlichen Schlüsseldatei ("putkey")
Terminal-Ausgabe:
Error 20: the key file does not exist!
Please import a correct public key file.
OK: the key file on the Thin Client was replaced successfully.
System-Rückgabewerte:
0 = OK
Bei Fehlermeldungen: Fehlernummer
Rückgaben auf Stdout (Linux) des SSH-Client beim Ausführen der Fern-Konfiguration zum Auslösen eines Neustarts des
Thin Client ("reboot")
Terminal-Ausgabe:
OK: the Thin Client is now rebooting!
System-Rückgabewerte:
0 = OK
Bei Fehlermeldungen: Fehlernummer
Rückgaben auf Stdout (Linux) des SSH-Client beim Ausführen der Fern-Konfiguration zum Ersetzen des Hintergrundbildes
("setbackgr")
Terminal-Ausgabe:
Error 40: background picture file does not exist!
Please import a correct background picture file.
Error 41: the size of the uploaded file exceeds 1,5 MByte!
Please upload a smaller PNG image file.
Error 42: the uploaded file seems not to be a valid PNG image file!
Please upload a correct PNG image file.
Error 43: the resolution of the uploaded PNG image file exceeds the limits!
Please upload a PNG image file with a lower resolution.
Rückgaben auf Stdout (Linux) des SSH-Client beim Ausführen der Fern-Konfiguration zum Ausführen eines Firmware-
Updates ("update") auf dem Thin Client
Terminal-Ausgabe:
Error 50: the Thin Client firmware update file does not exist!
Please import a correct firmware update file.
Error 51: the firmware update of the Thin Client was not successful!
Please use a correct and suitable firmware update file.
Hinweis
Wenn das Update nicht ausgeführt werden konnte, wird zusätzlich zur Fehlernummer eine Logdatei auf der Terminal-
Ausgabe ausgegeben.
Siemens AG
Industry Sector
Postfach 48 48
90026 NÜRNBERG
Fern-Konfiguration und Fern-Update von Thin Clients Fern-Konfiguration und Fern-Update von Thin Clients
8
A5E02477565-02, 03/2010 A5E02477565-02, 03/2010
SIMATIC HMI
NOTICE
The SSH configuration service may be used by qualified personnel only.
The document provides a description of feasible mechanisms for the remote configuration and update of a SIMATIC
Thin Client with SSH. All SSH commands listed are based on Linux.
Introduction
SSH, as secure Telnet replacement, provides three key features:
● Authentication of the opposite station
● Encryption of the data transfer including the log-on information.
● Data integrity, i.e. protection against manipulation of transfer.
Requirements
The following requirements must be met for the remote configuration and update of a Thin Client:
● The Thin Client is logged on to a TCP/IP network and can be accessed by means of an IP address from an SSH Client,
such as a server or PC.
● An SSH Server is running on the Thin Client and can be reached via standard port 22.
● Standard programs which support the SSH protocol are installed on the server or PC, for example, OpenSSH, WinSsh or
WinSCP.
● In the examples, the IP address "192.168.11.229" used is replaced by the IP address of your Thin Client.
General information
● Several Thin Clients can be configured automatically, for example, using the "cygwin (www.cygwin.com)" environment.
● The examples provided in this document apply to the "Linux" operating system.
● The user name of the Thin Client is always "tc".
NOTICE
First log-on
The following message appears during the first log-on:
The authenticity of host ‘<IP Address>’ can’t be established…Are you sure you want to continue connecting (yes/no)?
Confirm this message with "Yes". The IP address is added to the list of known hosts.
© Siemens Ⓟ2010
A5E02477565-02, 03/2010 9
Authentication
Overview of security mechanisms
Overview
SSH provides three security mechanisms:
● Authentication of the opposite station
● Encryption of the data transfer including log-on information.
● Data integrity, i.e. protection against manipulation of transfer.
NOTICE
SSH password
Authentication with SSH password is no longer supported. Use a key file instead.
With asymmetric encryption, a key pair is generated whose keys depend mathematically on each other through encryption
algorithms such as RSA or DSA. What is encrypted with one key can be decrypted again with the other key. This means one
of the two keys can be made publicly available to encrypt transmissions. The transmissions can then only be decrypted with
the other key, which is private and inaccessible.
In return, a data package can also be encrypted with the own private key. If this encrypted text can then be decrypted with
the public key, it is ascertained that the entire data package comes only from the owner of the private key (digital signature).
CAUTION
Danger of data misuse
The private standard key file is identical for each device. Use the standard key file to generate a new key pair. Then use
only the new key pair.
Procedure
To install the private standard key, follow these steps:
1. Download the file you have received from "Technical Support (http://support.automation.siemens.com)" to your PC.
2. Store the file as "id_rsa" without file extension in the folder that contains SSH or tools to generate a key pair, for example,
"ssh-keygen".
3. In the command line, enter the switch -i id_rsa for each command.
The content of the file "id_rsa" is transferred as private key to the Thin Client. For further information, refer to the
documentation of those tools.
Requirement
The following key files are available:
● The private key file, for example, "id_rsa", locally on the PC.
● An appropriate "public" key file, for example, "id_rsa.pub", on the Thin Client.
Procedure
To generate a new key pair, for example, with "ssh-keygen", follow these steps:
1. Enter the following command:
ssh-keygen -t rsa -b 1024 -f id_rsa
A 1024-bit "rsa" type key is generated under the name "id_rsa" in the folder.
2. Do not make any entry for the requested "Passphrase", and press <Enter> twice.
The key pair will be generated.
3. To transfer the generated public key to the Thin Client, enter the following command:
scp -i id_rsa id_rsa.pub tc@192.168.11.229:/key/id_rsa.pub
The new public key must be stored in the "/key" folder under the name "id_rsa.pub".
4. Activate the key on the Thin Client by entering the following command:
ssh -i id_rsa tc@192.168.11.229 putkey
The new public key is installed on the Thin Client. In the following sections you use the new private key to execute the
secured "ssh" and "scp" commands, for example, scp -i id_rsa ...
NOTICE
SSH password
Authentication with SSH password is no longer supported. Use a key file instead.
Requirement
The following key files are available:
● The private key file, for example, "id_rsa", locally on the PC.
● An appropriate "public" key file, for example, "id_rsa.pub", on the Thin Client.
For more information please refer to chapter Authentication (Page 10).
Procedure
To load the new configuration file, follow these steps:
1. Enter the following command:
scp –i id_rsa thinclient.cfg tc@192.168.11.229:/conf/thinclient.cfg.restore
● Transfer the configuration file to the Thin Client using the following command:
ssh –i id_rsa tc@192.168.11.229 restore
The Thin Client is automatically shut down and restarted. The installed configuration data is now valid.
Update firmware
Introduction
To run a remote update of a Thin Client, upload the update file with the new firmware to the Thin Client and then start the
update process. To do this, enter the private key file in the command line.
NOTICE
Save the update file to a folder named "/update/fw_update" on the Thin Client. You can choose any name for the update
file.
Procedure
1. Use the following command to transfer the update file to the Thin Client:
scp –i id_rsa FWupdateDateiTC.upd tc@192.168.11.229:/update/fw_update
Replace "FWupdateDateiTC" with the name of your update file.
2. Initiate the update on the Thin Client by entering the following command:
ssh –i id_rsa tc@192.168.11.229 update
The Thin Client is automatically shut down and restarted. The installed firmware is now valid.
See also
Generate new key pair (Page 11)
NOTICE
Save the background image to a folder named "/backgr/backgroundPic.png" on the Thin Client. You can choose any name
for the background image.
Procedure
NOTICE
Delete background image irrevocably
The current background image will be deleted and cannot be restored. You can, however, download the SIMATIC
background image from the Service&Support pages.
1. Transfer the background image to the Thin Client by entering the following command:
scp –i id_rsa myBackgrPic.png tc@192.168.11.229:/backgr/backgroundPic.png
2. Activate the background image on the Thin Client by entering the following command:
ssh –i id_rsa tc@192.168.11.229 setbackgr
See also
Generate new key pair (Page 11)
Example:
The following values are not updated because of errors:
<tr><td height="10" width="64"></td></tr><tr><td width="64"></td><td>Warning: the new value
"192.168." of variable NET_IP_ADDRESS is not valid.</td></tr> <tr><td
width="64"></td><td><b>RESTORE OK.</b></td></tr>
Restore continued.
OK: Restoring of Thin Client was successful.
Thin Client is now rebooting.
System return values:
0 = OK
In case of error messages: Error number
Return values to Stdout (Linux) of the SSH Client during activation of the public key file ("putkey")
Terminal output:
Error 20: The key file does not exist.
Please import a correct public key file.
OK: The key file on the Thin Client was replaced successfully.
System return values:
0 = OK
In case of error messages: Error number
Return values to Stdout (Linux) of the SSH Client during remote configuration for triggering a restart of the Thin Client
("reboot")
Terminal output:
OK: The Thin Client is now rebooting.
System return values:
0 = OK
In case of error messages: Error number
Return values to Stdout (Linux) of the SSH Client during remote configuration for replacing the background image
("setbackgr")
Terminal output:
Error 40: background image file does not exist!
Please import a correct background image file.
Error 41: The size of the uploaded file exceeds 1.5 MB.
Please upload a smaller PNG image file.
Error 42: The uploaded file seems not to be a valid PNG image file.
Please upload a correct PNG image file.
Error 43: The resolution of the uploaded PNG image file exceeds the limits.
Please upload a PNG image file with a lower resolution.
Return values to Stdout (Linux) of the SSH Client during remote configuration for updating the firmware of the Thin Client
("update")
Terminal output:
Error 50: The Thin Client firmware update file does not exist.
Please import a correct firmware update file.
Note
In addition to the error number, a log file is output to the terminal if the update failed.
Siemens AG
Industry Sector
Postfach 48 48
90026 NÜRNBERG
Remote configuration and remote update of Thin Clients Remote configuration and remote update of Thin Clients
16
A5E02477565-02, 03/2010 A5E02477565-02, 03/2010