Skip to content

Instantly share code, notes, and snippets.

@adanacs
Last active March 5, 2024 06:15
Show Gist options
  • Save adanacs/80ea61edc1240d25c7d8d144f6e6608d to your computer and use it in GitHub Desktop.
Save adanacs/80ea61edc1240d25c7d8d144f6e6608d to your computer and use it in GitHub Desktop.
Setup Git on WD My Cloud EX2 Ultra

--Setup Git on WD My Cloud EX2 Ultra

  • Turn on SSH
  • Install Git (Hi, just download git from EX2 repository - http://downloads.wdc.com/apps/WDMyCloudEX2/git/WDMyCloudEX2_git_1.40.bin55 open it in HEX editor - and change 4B 69 6E 67 73 43 61 5A (KingsCaZ) to 47 72 61 6E 64 54 65 5A (GrandTeZ) at first string. Save it, and then do install it over "Install an app manually" link in AppStore tab.
  • Create repo folder and make group writeable
  • Create a user and add to group
  • Update user account to point to user share folder
  • Create SSH Key and copy .pub to /shares/user/.ssh/authorized_keys
  • Set permissions cd /shares/user; chown user . ; chmod 0755 . ; chown -R user .ssh ; chmod go-rw -R .ssh
  • Add to /mnt/HD/HD_a2/Nas_Prog/git/start.sh
  • sed -ir 's/(AllowUsers .*)/\1 alice bob/' /etc/ssh/sshd_config
  • kill -HUP cat /var/run/sshd.pid
  • restart device
  • git clone user@remote/shares/GitRepoPath/repo

Refs https://cutecoder.org/software/git-server-network-drive/ https://community.wd.com/t/how-to-install-git-server-on-my-wd-my-cloud-mirror-gen-2/214994/3

@yayino7
Copy link

yayino7 commented Oct 17, 2018

Dear adanacs, thank you for the post it was very helpful. I got to point 4, and then got lost.
I was wondering if you could spare me few mins and point me to the right direction.

I am accessing the drives (Cloud EX2 Ultra web control panel) from a windows machine and can also see the drive on windows explorer.

not sure how to point the user account to the folder can even go to the folder the repo i created.

plus not sure how to run those commands.

I hope i don't discourage your response by asking basic questions, i am new.

@omidkrad
Copy link

omidkrad commented Mar 3, 2019

Easier way is to just use the NAS as a file based git remote:

cd repos/my-project
git clone --bare . \\MyNAS\repos\my-project
git remote add origin \\MyNAS\repos\my-project
git push --set-upstream origin master

@emaV
Copy link

emaV commented Apr 11, 2020

You may be interested in implementing git-shell-commands.

Please check: How to use WD My Cloud as git server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment