#How to Gain Root Access to Modify Host Folderd with Docker It's easier as mounting the target folder in the container and modifying it. docker run -ti -v/etc:/working ubuntu bash Now you have access without typing sudo in your host.