Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Yocto, how to read a git repository via ssh on a nonstandard port

Tags:

git

yocto

I created a recipe containing these definitions:

SRC_URI = "git://git:<password>@<ip address>:<ssh_port>/home/git/tuxin-repo/project.git;protocol=ssh;branch=test"
SRCREV_default = "5a0b8545d39c97bd9f9628143ed174dabb71f641"

bitbake ends with errors

ERROR: Fetcher failure: Fetch command failed with exit code 128, output: Cloning into bare repository '/home/yocto/build/downloads/git2/..home.git.tuxin-repo.project.git'... Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,password). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

ERROR: Function failed: Fetcher failure for URL: 'git://git:@:/home/git/tuxin-repo/project.git;protocol=ssh;branch='test''. Unable to fetch URL from any source. ERROR: Logfile of failure stored in: /home/yocto/build/tmp/work/cortexa8hf-vfp-neon-poky-linux-gnueabi/capsystem/1.0-r0/temp/log.do_fetch.7045 ERROR: Task 4 (/home/yocto/sources/poky/../meta-tuxin/recipes-support/project/project.bb, do_fetch) failed with exit code '1'

while in command line, and after typing the password, the project is loaded.

git clone --branch test ssh://git@<ip_address>:<ssh_port>/home/git/tuxin-repo/project.git

Can someone explain to me my mistake?

like image 418
Tuxin Avatar asked Nov 06 '22 20:11

Tuxin


1 Answers

You have to specify the SRC_URI in this way:

SRC_URI = "git://git@<ip address>:<ssh_port>/home/git/tuxin-repo/project.git;protocol=ssh;branch=test"

Note the use of git@ before the IP address. You cannot specify the password in the SRC_URI as a security measure. For automatic authentication you will have to use other methods as .ssh/config

like image 177
esguti Avatar answered Nov 15 '22 06:11

esguti