i9x0.SFTPServer
With this functionality, some parts of the file system (e.g. the SD card) can be accessed via Ethernet.
Activity Diagram
Physical and logical access
-
Connector X16 (Engineering Access)
-
Connector X2x6/X2x7 (fieldbus device)
Only if a fieldbus (e.g. PROFINET Device with X256/X257 or EthernetIP Adapter X266/X267) is included in the device tree of the i9x0 servo inverters in the PLC Designer and the IP-Configuration 0x2381 is set in the parameter set.
-
Used port for SFTP is 47877/tcp
i9x0.SFTPServer: Access to the SD-Card
Access to the file system via SFTP has been available since firmware version 01.00.00.
A suitable SFTP client is required for this access. In the following, for example, WinSCP(https://winscp.net) is used.
Start WinSCP and enter the necessary data, as shown in the following picture.
WinSCP Login
Insert the following data
-
File protocol: SFTP (communication protocol)
-
Host Name: IP address of the i9x0 servo inverter
-
Port Number: SFTP port number of the i9x0 (use port 47877)
-
User Name: customer
-
Password: keep this password empty
Next, the Advanced dialog must be used. A .ppk file is needed to insert the private key file into the Menu/Authentication window. You can find the file in the Lenze internal AKB (document ID 201800294). Please contact Lenze Support.
Insert customer.pkk key-file
After agreeing to the following warning, some directory paths can be accessed on the i9x0 Servo Inverters.
Agree to Warning
i9x0.SFTPServer: Changing the customer.ppk
Changing the customer.ppk has been available since FW version 01.05.00.
This description is required if the access key (customer.ppk) for SFTP access to the i9x0 is to be individualized. To do this, a separate key must be generated.
Note that the resetting of a key in the i9x0 once changed can only be carried out by the "reset to factory settings" device command (refer to chapter i9x0.SecureFactoryReset). Therefore, great care must be taken when storing and archiving a new key.
A private key once changed can also be found in a backup of an i9x0 and thus automatically becomes active during a restore on a new device.
Constraints on the key
-
RSA
-
minimal length of 2048 Bits
Generate a new key
-
After starting the WinSCP program, press the "Tools" button in the "Login" dialog that opens automatically. From the menu that appears, select "Run PuTTYgen" to start the PuTTYgen program. PuTTYgen is responsible for key generation. Note: The "Run PuTTYgen" entry is not visible when using WinSCP Portable.
WinSCP using Tools / Run PuTTYgen
-
In PuTTYgen, the key type to be generated (RSA) is set and the length of the keys is specified in bits (minimum 2048 bits). By pressing the “Generate” button the new key pair is generated.
PuTTY Key Generator
-
After creating the key, you can enter a comment before saving. A password (here called “passphrase”) can also be set; the necessity for this must be decided depending on the application. Among other things, it should be taken into account that this “passphrase” must be entered on the PC every time the private key is used. The private key can now be saved for later use using “Save private key”.
PuTTY Key Generator: Safe Private Key
-
In order to make this private key known to a device, the contents of the text box “Public key for pasting into Open SSH authorized_keys file” must be copied and saved in an ASCII text file named “customer.key”. Care must be taken to ensure that the content is not changed: it is a single long line.Note: The file created with “Save public key” cannot be used. For the “public key”, the text must be copied as described above.
Safe Public Key
Advertise a new Private Key in the i9x0:
-
The file “customer.key” must be on the device's SD card in the existing "public key" directory. For security reasons, the directory “/sdcard/public-key” can only be accessed via SFTP in read-only mode; therefore the file must be copied to the SD card, e.g. on a PC.
-
The currently active private key establishes an SFTP connection to the device.
-
The file "customer.key" is now stored via SFTP in the device in the directory "/tmp/user_data".
-
The storage process is registered by the device; as a result, the transferred file is stored and checked for correctness:
-
On the SD card, an identical file .key must be placed under "public-key/customer.key".
-
The file may contain only one line with an RSA key (empty lines are ignored).
-
The line with the RSA key must withstand rough validation.
-
The RSA key must be at least 2048 bits long.
No matter what the result of the checks is: The file "/tmp/user_data/customer.key" is automatically deleted from the device.
If a check is not successful, the directory "/tmp/user_data" generates a file called "customer.key.ret" with a corresponding error message.
Possible error messages:-
unable to read "/sdcard/public-key/customer.key"
-
"/tmp/user_data/customer.key" does not match "/sdcard/public-key/customer.key"
-
RSA key required
-
not a valid RSA key
-
RSA key of at least 2048 bits required
-
-
-
After a successful transfer of the file "customer.key", the current SFTP connection must be disconnected and a new SFTP connection must be established using the new private keys. If this fails, it must be checked that the transferred file "customer.key" belongs to the new private key used.
-
The transferred file "customer.key" has been correctly created and saved.
-
The private key used has been saved correctly.
If successful, the new private key can now be used for SFTP connections to the device.
-
Information on handling
-
The new key will continue to work if the SD Card is changed or deleted.