-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Need to add --work-path to authorized_keys #9481
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
Comments
@zzps Perhaps at what repo you install Git? And can you provide full log for this issue? |
ok ,I have said that when gitea is not work, I do that use gogs with same way on the same machine . and clone work fine both over ssh and http. so it can prove git is ok. [oauth2] [security] [database] [repository] [server] [service] [picture] [openid] [session] [log] and I try : ssh -vT [email protected] .the response is |
more information! when I use gitea inernal ssh server by add |
You cannot share the |
I create user git just for run gitea,no others。by the way I have said gogs works fine, and use gitea built ssh server works fine |
You can go to gitea ui -> admin panel and run |
The key you use to connect to Gitea must be controlled by Gitea. That is, it must have been added to Gitea's db and must have been added to the authorized_keys file by Gitea. |
i have done all that steps , no work! |
yes! I actualy do all these operation, but no work! but gogs works well ! |
Are you running gogs and Gitea with the same user? Your description seems to imply that. That won't work and I'd ask you to think about why because the reason is simple. Remove all of the gogs lines from authorized_keys. |
I do the gitea install strictly by the document, I see the key be added to the db and authorized_keys file all things be done ok, and it is fine in gogs but can not work in gitea |
|
If Gitea works on the internal SSH server then the problem lies at authorized_keys. Let us begin again.
I assure you this works - I use open sshd with Gitea myself - so the problem is with your configuration. For simplicities sake don't try pushing just try SSHing in - that way we know if your key is being properly matched with an authorized key line. |
ok, now I answer your question one by one: gitea public keycommand="/usr/local/gitea/gitea --config='/usr/local/gitea/custom/conf/app.ini' serv key-14",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDkeFfDMzT355/gLB2OooglszXmLcYlOz/wrDjR4aJNV2aPBq7uKwktdZb+7ECZTT2DK6/BaC5cnbOmlqCt78dNWEMKx7jSgAOpEQSqY6EBGSsSkoQsXwjOwrfOPAfG/tQAXIKDhv51ih71MzHZFxcvw/eIOq+h3YvduBxXlrplJ+OfU68ecD26mCkrLhQCdB51ZZnSpGWJyEGucnXOrxuRooUlPZJnNSiRNb6nUmNKpsNqACygBJduxOIvVcEhizy6SSwXT0H+TQdE3kkfuCYHH7P9pShlPR5R5nyXRg/BZdA0tjPiD3CES5xnrc4tuiGBl/TpT4/t+RLPPzTgZSw3ayYXHzZMrLsoaMS5gpCK6TaJIc5OyS7oDNuDCRqPyJphQjISFG3kk+y2/Dnoy00TgAwJq5vaDBFiJwmpF/RQ3w9Dqb9PNNuCdhchCaPHnzOZqRvP82uQV2Nzv+0rBYAt3NQFAP0cZdXN+Td7kFvkrvFgaI3nkrxjilVnQPIUmywosmjcU1Rf+wN0hMSzJhOcOatef40vgM9MKUYQIRfaWpIPy4TTPs0LqPwPNIeSO8/TeS2VG0kmZAvlzEzH6AuXDTrEt1QmESD8w/iqrVDj8V9rZLKWDqBkV0TmGDgALyx/O7SLzdJLNU1ud5rbGGWZVty9tR5rQyAvZobraAA11w== HZQ@DESKTOP-PC28 4, I am sure I remove "START_SSH_SERVER = true" ,so it run with system ssh 5, every time I will manual delete authorized_keys and use Update the '.ssh/authorized_keys' on the gitea web ui for a new one 6, no more log I can find ,only gitea.log with a lot of sql, no valuable message |
What happens if you SSH directly without going through git? You should get told you have authenticated by Gitea does not provide a shell or thereabouts |
ssh [email protected] |
Well that's interesting. From a command line on the server run:
|
/usr/local/gitea/gitea --config='/usr/local/gitea/custom/conf/app.ini' serv key-17 |
Did you deliberately change the key number? I'm going to assume that the key number still matches authorized keys. So now the question comes as to why SSH can't run or it fails for that command. There's an interesting bit where SSH states Pty allocation failed. Now that's weird because we explicitly say don't give a Pty in our authorized_keys So I wonder, if you remove the no-pty from the authorised_keys line if that helps things. Did Gogs have that too? Another thing is if your key having a non ASCII name if that is a cause of problems - it shouldn't be - but it might be worth a try to see if things work if you change it something like pi-key. |
because I have change the key before run ,so that I should replace serv-14 to serv-17, and your command is serv-14 and I run serv-17,it doesn't matter. |
Any progress on testing the pty things? |
You just need to remove the no-pty, from the authorized_keys and try SSHing again |
after remove no-pty in the authorised_keys |
it still can not clone over ssh |
I think I should show you a strange discovery, the gitea generate authorized_keys and the line !!!may be it is the clue!!!!! |
So for some reason it appears SSH cannot run the command. I guess check the permissions for everything? Is there a difference with gogs? |
I have check everything permissions , no difference with gogs. |
Have you tried run |
done that and no help . and I move the environment to machine :192.168.1.250, and do all the step as document, it still doesn't work ! |
Hi @zeripath, I am using the official binary gitea-1.10.0. Per the doc at install-from-binary, I thought custom directory layout should work out-of-the-box. Or am I missing anything? |
no you're not missing anything - just that if you were building from source you could simplify your codes to make everything a bit easier. Anyway am I reading your comment correctly that you had to manually add a work-path to authorized_keys - if so that's a bug and we should fix that. |
Yes, I have to manually add |
I discovered yesterday that if the git user does not have a working shell (I had it set to |
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. You can re-open it if needed. |
@zzps sorry we still haven't been able to work this out. Generally this is very easy. Gogs may work simply because it doesn't attempt to communicate with the running Gogs server. I still don't understand where things are failing for you. There's something odd about your set-up that is breaking things - I also can't understand why people would ever need the work-path setting up either. I'm going to take a look at the work-path now. |
I still can't work out why you would ever need to set the --work-path - except if your config option is incorrect... None of this makes any sense. |
maybe you chould check my compute , i could give you ip and account over secret channel |
you can message me on discord as @zeripath |
how? email or? |
Per the comment, I have to add |
@sunbing81 - so I had a cursory look at this yesterday - I still can't work out why you need to do this. I wonder if something is trying to create a directory. Do you have |
Ah... what do you have set for |
Fix go-gitea#9481 (probably others too) Signed-off-by: Andrew Thornton <[email protected]>
Fix #9481 (probably others too) Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: Lauris BH <[email protected]>
Yes, I have a
I have a |
could you give me an email address? |
@sunbing81 - so your problem should have been fixed by #11136 |
Fix go-gitea#9481 (probably others too) Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: Lauris BH <[email protected]>
[x]
): tidb 3.0 ok for mysqlcan not clone repository over ssh , and it is work over http
Description
Screenshots
The text was updated successfully, but these errors were encountered: