Skip to content
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

Do not overwrite authorized_keys when using built in server #2046

Closed
pgaskin opened this issue Jun 23, 2017 · 6 comments
Closed

Do not overwrite authorized_keys when using built in server #2046

pgaskin opened this issue Jun 23, 2017 · 6 comments
Labels

Comments

@pgaskin
Copy link
Contributor

pgaskin commented Jun 23, 2017

  • Gitea version (or commit ref): f2afed3

Description

The admin action for rewriting authorized keys currently overwrites authorized_keys, even when using the built in server.

This should not happen because it may lock users out if running it as their main system user with the same authorized keys for ssh and gitea.

@lunny lunny added the type/enhancement An improvement of existing functionality label Jun 24, 2017
@lunny lunny added this to the 1.x.x milestone Jun 24, 2017
@noerw
Copy link
Member

noerw commented Jun 28, 2018

Holy shit, this is bad.
This happened to me, I guess I have to call support of my hoster now..

Can we please

  • label this as bug
  • make the option to override authorized_keys unavailable when using native SSH
  • or: add a hook to revert to original authorized_keys via the frontend?

To help me explain to support: How is gitea even able to take over the SSH daemon?

edit:
Alright, I manged to ssh back into my machine by adding a new ssh-key to authorized_keys via the web interface of my hosting provider. This is bad none the less

Btw, I clicked that button, as this was suggested in order to make the advertised ssh clone URL work!

@lunny
Copy link
Member

lunny commented Jul 6, 2018

I think this has been fixed by #3377. @noerw which version did you use?

@lafriks
Copy link
Member

lafriks commented Jul 6, 2018

Yes, this is fixed by #3377

@lafriks lafriks removed this from the 1.x.x milestone Jul 6, 2018
@noerw
Copy link
Member

noerw commented Jul 6, 2018

@lunny This happened with v1.4.3. Thanks for the feedback!

It seems I misunderstood how it works then, I was not using the built in SSH server, and locked myself out anyway.
Later I found warnings about this in the documentation, but IMO there should be a big red sign next to the button and not in some document. Or better (as described above), provide a way to undo the action.

@lunny
Copy link
Member

lunny commented Jul 8, 2018

@noerw #3377 has fixed this actual issue but not hide the rewrite public key item on Admin Panel. But in fact, if you are using internal SSH and you click that button, it will do nothing. see https://github.com/go-gitea/gitea/pull/3377/files#diff-bc1f3a75a0a9d450f654cec20fd672e9R541

@lafriks
Copy link
Member

lafriks commented Jul 12, 2018

@noerw you should never be using same account you log into system for any system service

@lafriks lafriks closed this as completed Jul 12, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants