tags:

views:

309

answers:

2

Hi Guys,

I have justed installed openSSH and I am having trouble with the server URL for SSH. When open a bash - I can login successfully as

ssh [email protected]

In this directory I have /Git - which is the folder storing my repository - however when I try

ssh [email protected]:/Git

I get

ssh: Could not resolve hostname some.ip.address:/Git: no address associated with the name

When I login via just ssh [email protected] - then execute "ls" - I can see "Git" as a directory.

How do I actually get the proper "Arbitrary URL" in Git correct - i.e. I assumed it was

ssh://[email protected]:/Git

? Thx

+1  A: 

You can't ssh into directory. What are you trying to accomplish? You can use "ssh url" user@host:/directory with git, but you can't ssh there.

git remote add onhost user@host:Git
git fetch onhost

One more thing you can do with this url is feed it to sftp:

sftp user@host:Git
Michael Krelin - hacker
hi :) well yeah i am just try to access a directory i guess initially. at the moment i am just in bash trying to get to git - even when i type ssh user@host:/Git - i get "Could not resolve hostname some.ip.address:/Git: no address associated with the name"
Like I said, it's not supposed to work as ssh endpoint. It is fine to use it as a git url, though.
Michael Krelin - hacker
ah ok cool :) so i guess its supposed to generate this error and not login and take to me to the directory (which i thought it should do) ?
Yes, it's expected behaviour.
Michael Krelin - hacker
A: 

When you log-in using ssh you are usually left in your home directory /home/bob. This means that ls will show Git if it is in your home directory. The address in your example assumes Git is in the root of the filesystem, which seems unlikely.

Try this address:

[email protected]:~/Git


These addresses are not ssh syntax even though they use the ssh protocol – they are closer to scp syntax. If you can successfully run

scp -r [email protected]:~/Git .

then everything should work (note that this may take a while because it copies your whole repository!).


You can drop the ssh:// prefix in your address – [email protected]:/Git will work fine.

Alex Brown