Illustration: Docker container security - disabling SSH for production environments.

[Dockerfile] How to Prevent Docker Container from SSHing

While SSH is a valuable tool for debugging and testing Docker containers, enabling it in production environments is not recommended due to security concerns. To disable SSH in a Docker container, it’s advisable to remove the SSH server during the image building process. One way to accomplish this is to remove the SSH server during the Docker image building process. For example, if you’re using the alpine base image, you can use the following Dockerfile: ...

[Golang] go get: fatal: could not read Username for 'xxx': terminal prompts disabled

1. Error 1: fatal: could not read Username for 'https://github.com': terminal prompts disabled The issue appears when I tried to download a private golang repository by the command go get github.com/oscarzhou/private-helloworld. The completed error shows as below: % go get github.com/oscarzhou/private-helloworld go: module github.com/oscarzhou/private-helloworld: git ls-remote -q origin in /Users/oscarzhou/go/pkg/mod/cache/vcs/c5fb5660c8bfa54f1b957fc4e651ac76f19b939fc9015bf3bcbc21a34c925af7: exit status 128: fatal: could not read Username for 'https://github.com': terminal prompts disabled Confirm the import path was entered correctly. If this is a private repository, see https://golang.org/doc/faq#git_https for additional information. If you have already googled this issue, you may find that most of the answers tell you to configure your git as shown below: ...

[Git] How to configure SSH profile for Github account

There are many benefits for using Git with SSH connection. Do not need to type the password every time when pushing the project. Able to configure multiple git accounts in the same machine without using password every time. For Golang projects that reference other Golang private repositories, SSH connection is must thing. This post will show you how to configure SSH profile for your GitHub account from scratch. I assume that you did not ever configure the Git on your host. To check it, you can run git config --global --list. The expected output should be empty. If it is not, don’t worry, leave it there for now. We can figure it out later. ...

[Windows] Enable Windows default SSH server

This topic is already well documented by mircosoft docs. You can find it from Get started with OpenSSH. Here I just want to give two tips for accelerating the setup. There are two ways to activate the open ssh server on Windows: from Windows Settings or PowerShell. Personally, I would recommend to use the PowerShell. Open the PowerShell as an Administrator. Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*' # Install server Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 # Start the sshd service Start-Service sshd # OPTIONAL but recommended: Set-Service -Name sshd -StartupType 'Automatic' # Confirm the Firewall rule is configured. It should be created automatically by setup. Run the following to verify if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) { Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..." New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 } else { Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists." } When you try to connect the OpenSSH server, you’ll need to use ssh username@servername. The servername is your device’s IP address. For example, 192.168.1.5. The username may confuse you. But you can find it by typing whoami in PowerShell or Command. It may look like laptop-nbgksu9c\user. In the ~/.ssh/config file, you can configure it like ...

DigitalOcean Referral Badge
Sign up to get $200, 60-day account credit !