Skip to content

Feature Request: modified authorized keys  #7699

Closed
@927589452

Description

@927589452

Description

Add an option to modify, what is written to the authorized_keys, so gitea can be used with the same key, which is also used for accessing the server.
An example for such a modification is this

command="if [ -t 0 ]; then bash; elif [[ $SSH_ORIGINAL_COMMAND =~ ^(scp|rsync|mysqldump).* ]]; then eval $SSH_ORIGINAL_COMMAND; else /home/<username>/gitea/gitea serv key-1 --config='/home/<username>/gitea/custom/conf/app.ini'; fi",no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-...

this is useful for shared hosting scenarios like the guide by @luto, where i copied this line from.

I would imagine an option
SSH_RESTRICT: %(giteacmd)s
and used like this
SSH_RESTRICT: if [ -t 0 ]; then bash; elif [[ $SSH_ORIGINAL_COMMAND =~ ^(scp|rsync|mysqldump).* ]]; then eval $SSH_ORIGINAL_COMMAND; else %(giteacmd)s ; fi",no-port-forwarding,no-X11-forwarding,no-agent-forwarding
for shared hosting, generating a line as describe above

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions