I realize this is a bit of a strange ask, but I'd like to access a Git repository from a LAN shared drive. I'm trying to host it on a Netgear D7000 router via SSH, with its "ReadyShare" function.
After enabling the FTP access method, I'm able to access the folders on the drive through my browser:
ftp://192.168.1.2/shares/U
Additionally, using WinSCP and other software, I can browse and upload files to the drive with the same address.
After some trial and error I managed to ssh
into it through the terminal:
ftp 192.168.1.2 21
After which it prompted me for credentials. Then I could cd
, ls
, and even create and delete folders - the router's media sharing appears to be a normal UNIX-based FTP server...
Correction: When I said I SSH'd into the router I was getting confused and used the ftp
command instead. ssh
did not work - it just hangs - and I just assumed the command line I got was the same thing.
Next I tried pulling a Git repository that was on the drive with
git clone ftp://192.168.1.2/shares/U/test.git
However it gave me this error:
fatal: unable to access 'ftp://192.168.1.2/shares/U/test.git/': RETR response: 553
I looked online but I couldn't find this exact error. After reading around I thought that it might be a permission problem, I tried adding the user:pass@
authentication to the URL like so:
git clone ftp://admin:pass@192.168.1.2/shares/U/test.git
But that returned the exact same 553 error...
All the folders on the drive were already set to 777, so that doesn't seem to be the issue.
Do I need FTP plugins for Git? Is there an argument I need to set? Am I missing something obvious? Please let me know if hosting a repo on a drive stuck into a router is even possible!
EDIT:
After jingx's suggestion I tried connecting to the repo with SSH. I tried as many variations as I could think of:
git clone ssh://192.168.1.2/shares/U/test.git
git clone ssh://admin@192.168.1.2/shares/U/test.git
git clone ssh://192.168.1.2:21/shares/U/test.git
git clone ssh://admin:pass@192.168.1.2:21/shares/U/test.git
However, I encountered errors for all of them. If I didn't specify the port it would return "Resource temporarily unavailable".
When I did specify the port things started looking promising; Git would create the project folder and print "Cloning into 'test'..." but would hang there for a few minutes before spitting out "Could not resolve hostname", "Could not read from remote repository", and finally "Please make sure you have the correct access rights and the repository exists".
I decided to disable the password for the ReadyShare connection completely in the router settings. I also tried running with my computer firewall disabled, but still no luck.
As I corrected above, I wasn't actually able to SSH into the router - I got confused and thought the FTP command line was the same thing as FTP. Running:
ssh 192.168.1.2 -p 21
Hangs for a minute or two and returns:
kex_exchange_identification: Connection closed by remote host
Thinking back I don't think it even supports SSH.