Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I cannot categorize this question under ubuntu since it has nothing to do with it. But I know people here can definitely answer this. I login to one of my deployment boxes using SSH (no ubuntu here).

I am working in a tool called TeamCity which uses a folder called ".BuildServer" under home directory of the user. This folder may grow in size as the application runs but the current user is only given a limited amount of space. But the good thing this I got a folder access outside /home/deploy (deploy being the user here) folder. I now want to link this .BuildServer inside the /home/deploy directory to the other folder where I got permission for (meaning all the files should be re-routed to that directory)

Hope my question was clear, please help.

share|improve this question
WHat have you tried already? I've not fully understood your question, do you want to move /home/user/.BuildServer to /home/deploy, and create the symlink /home/user/.BuildServer pointing to /home/deploy? –  Lekensteyn Jan 13 '11 at 20:19
"deploy" is the username. So user and deploy are both the same. My sys admin has created a folder under root and has given me privileges to use it. I now want to re-route this /home/deploy/.BuildServer to that folder under root to /under_root/somfolder –  bragboy Jan 13 '11 at 20:22

1 Answer 1

up vote 2 down vote accepted

You've multiple options if you want to point /home/deploy/.BuildServer to an other directory, /under_root/somefolder/.

1) Create a symlink

ln -s /under_root/somefolder/ /home/deploy/.BuildServer

You should remove the .BuildServer directory first. Alternatively, you can move the .BuildServer directory to the new location:

mv /home/deploy/.BuildServer/ /under_root/somefolder/

Now run the ln command (see above). Note: the user accessing /under_root/somefolder/ should have access to that folder. Say the user is deploy, somefolder is owned by deploy, but /under_root is owned by some other user. You've now two possibilities: let deploy be a member of the group, used for /under_root and give add the execute bit to the group. (chmod g+x /under_root). The other case is that deploy cannot have the groupship over /under_root. In that case, make sure that anybody can dive in the directory: chmod o+x /under_root). This has to be done for every folder "above" /under_root/somefolder.

2) Bind mount

This can only be done by a user with root permissions (ask your sysadmin).

mount --bind /under_root/somefolder /home/deploy/.BuildServer

Using this method, there is no need to mess with the permissions of /under_root. Another advantage over symlinks is that this method works even if ssh chroots to /home/deploy.

share|improve this answer
+1 Recipe assuming admins got the permissions correctly: 'mv /home/deploy/.BuildServer /under_root/somefolder; ln -s /under_root/somefolder /home/deploy/.BuildServer' –  user8290 Jan 13 '11 at 23:23
Sweet!! thanks... –  bragboy Jan 14 '11 at 7:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.