After wasting a couple hours I’ve found someone who had the solution, which I found through this guy’s blog.
In my case, what I had was a chroot jail inside a server (which I also had full control), here are the steps:
- Connect to the server
- Execute:
# xauth list devserver/unix:10 MIT-MAGIC-COOKIE-1 f44098e4ee6687e163c152a72c7dacbd
and copy the auth data;
- Enter the chroot jail, and execute
# xauth add devserver/unix:10 MIT-MAGIC-COOKIE-1 f44098e4ee6687e163c152a72c7dacbd
- And thats it, It should be working now.