Edit files with WinSCP as root user

By default, the user Administrator is not authorized to edit files that do not belong to him. To edit such files, you must obtain root access by adding your public key to the root user's authorized_keys file.

Notice The following procedure appends all authorized keys of the Administrator user to the authorized_keys file of the root user, effectively enabling root login via SSH. Activating the root login may pose security risks. Make sure you understand the implications and take the necessary measures to secure your system.

Proceed as follows:

1. First log in to the Beckhoff RT Linux® IPC via SSH as user Administrator:
ssh Administrator@<IP_ADDRESS>
2. Execute the following commands on the command line:
sudo mkdir -p /root/.ssh
sudo chmod 700 /root/.ssh
cat ~/.ssh/authorized_keys | sudo tee -a /root/.ssh/authorized_keys
3. You can now change the user to root in your WinSCP login configuration.
4. Click Save and then Login to connect as the root user.
You are now logged in as the root user.

Delete the file /root/.ssh/authorized_keys if you no longer require root access via SSH.

sudo rm /root/.ssh/authorized_keys