Forum / NoMachine for Mac / Cannot edit server.cfg
Tagged: server.cfg
- This topic has 5 replies, 3 voices, and was last updated 7 months, 1 week ago by horseman67.
-
AuthorPosts
-
February 22, 2024 at 03:54 #47124horseman67Participant
Hi,
So I’m following the instructions here: https://kb.nomachine.com/AR02L00785 on how to allow only public key auth with NoMachine.
However, when i try to edit /Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg
and update it with the line:Â AcceptedAuthenticationMethods NX-private-key
I get ‘permission’ denied errors – note I am doing this as ROOT but I’m still unable to modify the file.
Is NoMachine doing something strange with permissions or metadata? I’m really unable to edit this file even as root – very odd.
How do i do this so that i can set key only auth?
Thanks!
February 26, 2024 at 11:12 #47166BritgirlKeymasterPlease check that you actually have sudo privileges.
Open a terminal and from CLI try to edit the file, for example with vim:
sudo vim /Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg
or just use command:
sudo sed -i '' -e 's/^AcceptedAuthenticationMethods.*/AcceptedAuthenticationMethods NX-private-keytest/' "/Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg"
This will change the key to:
AcceptedAuthenticationMethods NX-private-key
February 26, 2024 at 13:16 #47168horseman67ParticipantThanks, but i’m 100% running this as root – there is some other strange setting nomachine has set (some SIP related thing?) that makes the files inaccessible even as root.
Here’s the result of your command, you can see i’m running as root. I don’t have this problem with any other app, only NoMachine – my friends who also have NoMachine installed on mac get the same issue.
/Applications/NoMachine.app/Contents/Frameworks/etc » sudo sed -i ” -e ‘s/^AcceptedAuthenticationMethods.*/AcceptedAuthenticationMethods NX-private-keytest/’ “/Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg”
Password:
sed: /Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg: Operation not permitted
February 27, 2024 at 13:16 #47180zaqParticipantHello Horseman67,
You need to grant Terminal.app ‘Full Disk Access’. Go to
‘System Settings’ -> ‘Privacy & Security’ -> ‘Full Disk Access’
and then reopen Terminal.app and run:
sudo sed -i -e "s/^AcceptedAuthenticationMethods.*/AcceptedAuthenticationMethods NX-private-keytest/" /Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg
February 27, 2024 at 13:59 #47181BritgirlKeymasterI just noticed a typo in the previous command I wrote, apologies for that. It should have been
sudo sed -i '' -e 's/^AcceptedAuthenticationMethods.*/AcceptedAuthenticationMethods NX-private-key/' "/Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg"
March 4, 2024 at 06:26 #47250horseman67ParticipantThanks that worked! Giving “full disk access” did it! I think this should be in the instructions!!!
-
AuthorPosts
This topic was marked as solved, you can't post.