Jenkins - Inheriting environment variables on Ubuntu Jenkins - Inheriting environment variables on Ubuntu jenkins jenkins

Jenkins - Inheriting environment variables on Ubuntu


An awkward workaround described by CloudBees is to set

PermitUserEnvironment yes

in the build agent system's sshd configuration file /etc/ssh/sshd_config (and restart the sshd service) and then add the environment variable assignment to the file ~/.ssh/environment for the Jenkins agent user account (and reconnect from the Jenkins master).


The easiest way to manage environment variables is to do so from within Jenkins.

Click on "Build Executor Status" on the main page to get to the nodes page, choose the node in question, hit Configure, and under the "Node Properties" section check the "Environment variables".

There you can add environment variables which will be available during a build.

You can also do this globally, for all Jenkins build machines, under Configure System > Global properties.