3

In the below script it is not waiting for passwd to enter it is ending with error message.

$ sudo ssh -i crowdpersona_key root@xx.xx.xx.xx bash -c ' git clone user@github.com/test1/crowdpersona.git && cd crowdpersona && mkdir attachments'
Error message : fatal: could not read Password for 'https://user@github.com': No such device or address
  • Why the sudo? – Kusalananda Feb 13 '18 at 13:12
  • ssh -i awaits an identity-file, but you're providing username/hostname afterwards. – Stefan M Feb 13 '18 at 13:26
  • edited my question, -i is for adding the .key file as input – Asha Datla Feb 14 '18 at 4:57
2

You do not need or want the -i on the ssh command.

The -i selects a file from which the identity (private key) for public key authentication is read.

see

man ssh

Your command will work:

sudo ssh root@xx.xx.xx.xx bash -c ' git clone https://user@github.com/test1/crowdpersona.git && cd crowdpersona && mkdir attachments'
  • i am using -i select the file( key) , earlier i missed it while posting sudo ssh -i crowdpersona_key root@xx.xx.xx.xx bash -c ' git clone user@github.com/test1/crowdpersona.git && cd crowdpersona && mkdir attachments' – Asha Datla Feb 13 '18 at 13:42
  • @AshaDatla if that is the case please correct your question using the edit button – steeldriver Feb 13 '18 at 14:02
-1

user@github.com/test1/crowdpersona.git is probably not a valid GitHub project URL. It's either git@github.com:user/project.git for Git over SSH, or https://github.com/user/project.git for Git over HTTPS. When presented with a non-existent project URI, GitHub asks for authentication (probably for looking up private repos):

$ git clone https://github.com/foo/bar.git
Cloning into 'bar'...
Username for 'https://github.com':

The git command is not able to read a password or username here presumably because no TTY is allocated.

$ git clone https://github.com/foo/bar.git
Cloning into 'bar'...
Username for 'https://github.com': ^C
$ ssh localhost git clone https://github.com/foo/bar.git
Cloning into 'bar'...
fatal: could not read Username for 'https://github.com': No such device or address

The solution is usually to use the correct project URI.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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