Mac agent security issue

Hello community,

I am trying to set up a Mac node in Jenkins. Connection via SSH works, file and directory sharing for SSH is enabled on the Mac. Copying the remoting.jar also works. However, when starting the agent, the following error message appears. The directory has read/write permissions for Everyone

[SSH] Starting agent process: cd “/users/jenkins/workspace” && java -jar remoting.jar -workDir /users/jenkins/workspace -jar-cache /users/jenkins/workspace/remoting/jarCache
Exception in thread “main” The specified remoting internal directory should be fully accessible to the remoting executable (RWX): /users/jenkins/workspace/remoting
at org.jenkinsci.remoting.engine.WorkDirManager.verifyDirectory(
at org.jenkinsci.remoting.engine.WorkDirManager.initializeWorkDir(
at hudson.remoting.Launcher.main(
Agent JVM has terminated. Exit code=1

Any idea what this could be?
Thanks in advance

Welcome back @astoffregen. :wave:

The error message you’re encountering seems to indicate that the Jenkins agent process is unable to access or create the specified directory /users/jenkins/workspace/remoting. To try and resolve this issue, you’ll need to ensure that the directory has the correct permissions and that Jenkins can access it. I’m not MacOs fluent, I use it as little as possible, but here’s what you could maybe do:

  1. Check Permissions: Ensure that the directory /users/jenkins/workspace and its subdirectory /remoting have the correct permissions. You can do this by running the following commands in your terminal on the Mac:
    ls -ld /users/jenkins/workspace/remoting
    This command should show you the permissions of the directory. It should have read, write, and execute permissions for the user running Jenkins (typically the Jenkins user). The permissions should look something like rwxr-xr-x. :thinking:
    If the permissions are not set correctly, you can change them using the chmod command:
    chmod -R 755 /users/jenkins/workspace/remoting
    This command sets the permissions to rwxr-xr-x, which should be sufficient.

  2. Check Ownership:Ensure that the directory is owned by the user running Jenkins. You can check the ownership using the ls -l command:
    ls -l /users/jenkins/workspace/remoting
    The owner of the directory should be the same user that runs Jenkins.

  3. Retry the Agent: Attempt to start the agent again from the Jenkins controller server. It should now be able to access the /users/jenkins/workspace/remoting directory without any issues.

I don’t feel like booting my Mac to test that, so take it for what it is, a shell attempt to fix a specific MacOs problem. :blush:

My $0.02.