Receving disconnect #3834

Closed
opened 2025-11-02 05:27:32 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @Th3Whit3Wolf on GitHub (Aug 24, 2019).

  • Gitea version: 1.9.2
  • Git version: 2.22.0
  • Docker version 19.03.1, build 74b1e89
  • docker-compose version 1.22.0, build f46880fe
  • Operating system: Debian 10,
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
2019/08/24 11:04:12 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "passwd", "must_change_password", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "language", "description", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation", "is_active", "is_admin", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "num_repos", "num_teams", "num_members", "visibility", "diff_view_style", "theme" FROM "user" WHERE "id"=$1 LIMIT 1 []interface {}{2}
2019/08/24 11:04:12 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM "notification" WHERE (user_id = $1) AND (status = $2) []interface {}{2, 0x1}
2019/08/24 11:07:03 ...go-xorm/xorm/rows.go:50:newRows() [I] [SQL] SELECT "id", "repo_id", "interval", "enable_prune", "updated_unix", "next_update_unix" FROM "mirror" WHERE (next_update_unix<=$1) AND (next_update_unix!=0) []interface {}{1566644823}
  • Docker-compose
gitea    | Received disconnect from 183.131.82.99 port 10840:11:  [preauth]
gitea    | Disconnected from 183.131.82.99 port 10840 [preauth]

Description

Receiving Disconnect from unknown ip address. I am using ufw and these ports aren't allowed. How can I prevent this?

Originally created by @Th3Whit3Wolf on GitHub (Aug 24, 2019). - Gitea version: 1.9.2 - Git version: 2.22.0 - Docker version 19.03.1, build 74b1e89 - docker-compose version 1.22.0, build f46880fe - Operating system: Debian 10, - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ```log 2019/08/24 11:04:12 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "passwd", "must_change_password", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "language", "description", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation", "is_active", "is_admin", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "num_repos", "num_teams", "num_members", "visibility", "diff_view_style", "theme" FROM "user" WHERE "id"=$1 LIMIT 1 []interface {}{2} 2019/08/24 11:04:12 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM "notification" WHERE (user_id = $1) AND (status = $2) []interface {}{2, 0x1} 2019/08/24 11:07:03 ...go-xorm/xorm/rows.go:50:newRows() [I] [SQL] SELECT "id", "repo_id", "interval", "enable_prune", "updated_unix", "next_update_unix" FROM "mirror" WHERE (next_update_unix<=$1) AND (next_update_unix!=0) []interface {}{1566644823} ``` - Docker-compose ```log gitea | Received disconnect from 183.131.82.99 port 10840:11: [preauth] gitea | Disconnected from 183.131.82.99 port 10840 [preauth] ``` ## Description Receiving Disconnect from unknown ip address. I am using ufw and these ports aren't allowed. How can I prevent this?
Author
Owner

@sapk commented on GitHub (Aug 24, 2019):

The port is the client side port not the server one.
From my log management, it must be a probe checking if the openssh server is impacted by a vuln.
image
You can use fail2ban to block this kind of behavior.

@sapk commented on GitHub (Aug 24, 2019): The port is the client side port not the server one. From my log management, it must be a probe checking if the openssh server is impacted by a vuln. ![image](https://user-images.githubusercontent.com/4052400/63638872-cb98fc00-c68d-11e9-9574-b84df143889b.png) You can use fail2ban to block this kind of behavior.
Author
Owner

@Th3Whit3Wolf commented on GitHub (Aug 24, 2019):

Thank you. It appears I set up my gitea fail2ban wrong. Since it is installed in user git's home directory the log path is logpath = /home/git/gitea/gitea/log/gitea.log not logpath = /home/git/gitea/log/gitea.log which I believe should apply to everyone who follows the docker install instructions. Because of my incorrect entry my fail2ban service wasn't running at all.

I think ideally this would be in the documentation.

@Th3Whit3Wolf commented on GitHub (Aug 24, 2019): Thank you. It appears I set up my gitea fail2ban wrong. Since it is installed in user git's home directory the log path is `logpath = /home/git/gitea/gitea/log/gitea.log` not `logpath = /home/git/gitea/log/gitea.log` which I believe should apply to everyone who follows the docker install instructions. Because of my incorrect entry my fail2ban service wasn't running at all. I think ideally this would be in the documentation.
Author
Owner

@Th3Whit3Wolf commented on GitHub (Aug 24, 2019):

@sapk Thank you for your help!

@Th3Whit3Wolf commented on GitHub (Aug 24, 2019): @sapk Thank you for your help!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3834