Skip to main content

Command Palette

Search for a command to run...

How to SSH login password free from Windows, Linux, Mac

It's very painful and annoying to always provide password for ssh login. But it can be fixed by auto password functionality of ssh

Published
•1 min read
How to SSH login password free from Windows, Linux, Mac

1. Linux OS & MAC OS

Run the following command on your bash (or any alternative like zsh, fish, etc) to set up auto ssh login.

ssh-copy-id -i "<Public key path>" "<user.name@email.com@host_ip_adress>"

Example: Linux example

Output: Screenshot 2021-10-29 132602.png

2. Windows

Run the following commands, in a local PowerShell window replacing user and host name as appropriate to copy your local public key to the SSH host.

$USER_AT_HOST="your-user-name-on-host@hostname"
$PUBKEYPATH="$HOME\.ssh\id_rsa.pub"

$pubKey=(Get-Content "$PUBKEYPATH" | Out-String); ssh "$USER_AT_HOST" "mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo '${pubKey}' >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

Example: Screenshot 2021-10-29 132457.png

Output: image.png

Express Ideas

Part 4 of 5

Small & self-contained tips that can help in many larger context. This is my attempt to help you out & shed some light on express ideas that helped me because it's just an idea that all you need 💡.

Up next

How to merge a specific directory or file in Git

Think of the following scenarios: There might be two branches with active development and one of the branch needs some specific (updated) file or directory. You don't want to merge the complete branch but just need some specific file(s). Similarly...