I don’t know that one. But a workaround I have found was as I said, run ssh to my own local system and there the new ulimit setting was applied! Then run anything I want from inside ssh. In my case it was the flatpack application OTPClient.
So the workaround/solution:
Creating the file:
/etc/security/limits.conf
With content:
@aario soft memlock unlimited
@aario hard memlock unlimited
And then running:
ssh aario@localhost
Considering that my username is aario
.
Inside the ssh session, the ulimit settings works. Even though outside of it the system might be a bit buggy and not respecting the configuration.
Thanks again for all your ideas and help.