Universal AutoLogonSequenceWithLogonAccount regular expression for PSM-SSH

Universal AutoLogonSequenceWithLogonAccount regular expression for PSM-SSH

137
Created On 11/10/26 11:01 AM - Last Modified 11/10/26 16:06 PM


Symptom


In some setups, the Unix target login prompts may not match the default regular expression pattern in the 'PSM-SSH' connection component.

image.png


 


Environment


12.2;12.6;13.0;13.2;14.0 Privileged Access Manager (PAM, self-hosted) PSM PSM - 12.6
Ubuntu - 20


Cause


1. Default regular expression:
####################​​​​​​​##########​​​​​​​##########
\[.*\@.* ~]\$ >exec su - {Username}
Password:>{Password}
​​​​​​​​​​​​​​##########​​​​​​​##########​​​​​​​##########​​​​​​​##########

2. This regular expression \[.*\@.* ~]\$ will only match the example below:
########################################
[something@something ~]$
########################################
We can use https://regex101.com/ to confirm.
image.png

3. We use the Ubuntu 20 login prompt as an example here:
########################################
something@something:~$
########################################
The default regular expression will not match the login prompt above. Again, we can use https://regex101.com/ to confirm.
image.png


 


Resolution


1. Update the parameter 'AutoLogonSequenceWithLogonAccount' as below:
########################################
.*\$ ?$|.*\# ?$|.*\x3e ?$|.*\% ?$|.*\] ?$|.*: ?$ >exec su - {Username}
Password:>{Password}
########################################

2. This regular expression pattern .*\$ ?$|.*\# ?$|.*\x3e ?$|.*\% ?$|.*\] ?$|.*: ?$ will be translated as below:
########################################
- anything ending with $ space
or
- anything ending with # space
or
- anything ending with > space
or
- anything ending with % space
or
- anything ending with ] space
or
- anything ending with : space
########################################

*Note: Login prompt without space or with 1 blank space will work as well for this regular expression pattern

image.png


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000001MXzCAM&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail