title: Jenkins - Shows file.AccessDeniedException: for custom workspace
body: <p>I have installed Jenkins on Ubuntu 16.04 and created one project using custom work space. When I run project, it shows me following exception related to access.</p>
  
  <p>I have tried following solutions, but it's not working. </p>
  
  <p>sudo chmod -R 777 DevQA/</p>
  
  <p>sudo chown -R jenkins DevQA/</p>
  
  <p>Can anyone please help me resolving this issue. </p>
  
  <p>Exception</p>
  
  <pre><code>Building in workspace /root/DevQA/ERBatch 
  java.nio.file.AccessDeniedException: /root/DevQA 
  at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) 
  at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) 
  at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) 
  at sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:308) 
  at java.nio.file.Files.createDirectories(Files.java:746) 
  at hudson.FilePath.mkdirs(FilePath.java:3273) 
  </code></pre>