Skip to main content

Connecting CODESYS PLC User Management to Linux User Management via PAM

The native Linux user management can be used as a backend for the CODESYS PLC user management (database). In this way, you can use the existing Linux users and groups for PLC user management within CODESYS.

. This has been possible since version 4.15.0.0 of the following Linux-based SL products:
  • CODESYS Control for Linux SL

  • CODESYS Control for Linux ARM SL

  • CODESYS Control for Linux ARM64 SL

  • CODESYS Virtual Control for Linux SL

  • CODESYS Virtual Control for Linux ARM SL

  • CODESYS Virtual Control for Linux ARM64 SL

. Requirements:
  • The PAM libraries must be installed on the Linux system (libpam.so).

  • The CODESYS controller must be configured to use the PAM backend (see Step 5 in the instruction below).

Note

The user and group backend is "read-only". Therefore, no data from the CODESYS user management is written to the Linux user management. You cannot add or remove Linux users and Linux groups. However, you can add, remove, or change the permissions of these users and groups in the CODESYS user management.

Procedure. Activation of Linux user management via PAM in the CODESYS Control runtime
  1. Stop the runtime environment, for example via f the Deploy Tool.

  2. Add the Linux user group codesyscontroladmin to your system, for example via the following command.

    (ssh):sudo groupadd codesyscontroladmin
  3. Add the user to this group who you want to use for the initial installation (<username>), for example via the following command.

    (ssh):sudo usermod -aG codesyscontroladmin <username>
  4. Log in again via ssh and use the groups command to check that the group has been added correctly. The group codesyscontroladmin should be included in this list.

  5. Configure the PAM backend.

    Edit the cfg file and change the following section, or add the section if it does not already exist:

    [CmpUserMgr] 
    UserDBBackend=0x0000007A
    UserDBConfigBackend=0
    UserGroupsDBBackend=0x0000007A
    UserGroupsDBConfigBackend=0
  6. Then restart the runtime environment.

    Now you can log in to your PLC from CODESYS and use this Linux user name (<username>) and the corresponding Linux password for the initial setup.