Question

I keep getting connection refused on port 22 after setting up endlessh

I checked the status and got this:

sudo systemctl status endlessh       
● endlessh.service - Endlessh SSH Tarpit
     Loaded: loaded (/etc/systemd/system/endlessh.service; enabled; preset: disabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2024-11-18 14:46:23 WAT; 3s ago
 Invocation: 4c6d6736d7264471afa29a70ebb4b850
       Docs: man:endlessh(1)
    Process: 51765 ExecStart=/usr/local/bin/endlessh (code=exited, status=226/NAMESPACE)
   Main PID: 51765 (code=exited, status=226/NAMESPACE)
   Mem peak: 1.9M
        CPU: 41ms

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
November 18, 2024

Hey!

Based on the output that you’ve shared the service is not running and has exited:

   Main PID: 51765 (code=exited, status=226/NAMESPACE)

Did you install the service by following the steps here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-an-endlessh-tarpit-on-ubuntu-22-04

Based on that status=226/NAMESPACE, what you could try is in your endlessh.service file, try disabling the namespace feature. You can edit the file with:

sudo nano /etc/systemd/system/endlessh.service

Look for any lines related to PrivateNetwork, ProtectSystem, or other namespace settings and comment them out (or set them to false). For example, if you see PrivateNetwork=true, change it to PrivateNetwork=false.

After making changes, reload the systemd configuration and restart Endlessh:

sudo systemctl daemon-reload
sudo systemctl restart endlessh

Let me know if this works!

- Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.