New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSH doesn't work on ports other than 22 in dockerized gogs #1788
Comments
You still have to use port 22 for the publish part. Set port 2222 within the gogs config and use -p 2222:22 for docker, than it will work. |
That is, I belive, the workaround I described. |
Please read my comment again. It's not exactly like you have written. The value within the gogs config is just for displaying the SSH port, so set it to 2222, map the publish attribute of docker still to 22 within the container and everything works like it should be. |
Ok, it's clearer now. |
不明白,,,, 如下创建我的容器 初始化 sandal-ui project后,得到这样的项目地址 暂时的两种解决办法 Note. |
Please speak English. |
em.... I can't figure out to make it work. Feedback & suggestion are appreciated.
I just followed the instruction at https://github.com/gogits/gogs/tree/master/docker Specifically, below is the cmds I executed:
Also tried to not use data volumn in gogs to exclude possible influence from other dependency, still the same. Searching on web, someone says that root can't login, and proposed to change sshd_config as below.
While some other saying the permission to authorized_keys should be 600.
I've not tried either of above two as I'm using docker gogs/gogs, and I assume the standard image should work out of box. thx very much in advance! |
Try change |
Hi @unknwon, thx for your help! Today, I tried with local coreos file system, it works without any problem for both sqlite and ssh. Thx very much to implement such an amazing OS software! Regards |
It used to be unclear what the difference between the two are.
Hi, I'm having the same problem then @simonacca. |
This is not possible when running in WSL2 under windows. |
Trying to changed the docker ssh port from default to 2222 in a dockerized environment doesn't work as expected.
Steps to reproduce:
/var/gogs/data/gogs/conf/app.ini
as follow:ssh://git@git.mydomain.com:2222/myuser/myrepo.git
git remote add origin ssh://git@git.mydomain.com:2222/myuser/myrepo.git
git push -u origin master
In pushing, you will get this error:
Additional info:
Workaround
A temporary solution is to use the port
22
inside the container and map it with-p 2222:22
.This is suboptimal since the urls generated by the UI will be wrong, in this case the url would have been
git@git.mydomain.com:cnb/scraper.git
, which is incorrect.The text was updated successfully, but these errors were encountered: