## SSH Keys

# Author: sayhi@harshitraj.xyz # Modified: Oct 2025 # Desc: SSH Keys of Harshit Raj for remote access to servers # Source: curl https://harshitraj.xyz/ssh_pub.txt
Tip: you can paste keys directly into ~/.ssh/authorized_keys.
## my fav machine
[default source]
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDHXHZerFzoDYEDRttMTxeC7uGGKYj1LtIThSVg9AeMvZ9sh/BSWnk77bhcR4Hsu4bCrz4al75MXgtGSNp9oY1dS3SsgyYlscB5zqGgBvV5+3BYWGuJIArwdv2J18p7c96h4yRk080wjc38HUxIf5eVWYRuVuDlYIEZxbYkkLaFzFS12PYWIb7xhD4s+4Vr7ZBxlOLFhzRczPhiFdP+f38HOBGwwhjCXdUyHwJq+zDSa7wYNDyH8rMcJfMt7SBvG6MsTut9wW+0uYGBTxShCwnSUeDDeCzsv5gyXyIwhA4lQ/nYR8SJSGCNc/4Vd3XjVxqyBIVKAJaltEdYJa02RblOO3RfJGDa1GiQ3c+Dl0eaYej9vX+gt7oGBsSmGj9FPRe1n8iQYt2xNFaNeSWVYD5tS4nwMxTzMYDn5AruO0UJwzzArjmi4NyuZDVSaodya4YPx6X7a5mChCEpZa/1LXeTz5cs0yoeMajIsO+pecp8BmbSuaS5Xvw5ly8ca9SOkTk= salazar@stigma
## office PC
[Work 1]
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFHBR4U9+t+NE3etsng9r+s4kIZf2ALoidCRcjnusTbD harshit@GGNDSYS268
## office MacBook
[Work 2]
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMI8jD8BoTbIY6iugWqC3xnE6Lj+p39C3Vy3ay3zPt8r harshit@Harshits-Work.local
How to add to ~/.ssh/authorized_keys Linux/macOS
Creates .ssh, appends keys, fixes permissions (safe + standard)
# 1) Create SSH dir + set safe permissions
mkdir -p "$HOME/.ssh"
chmod 700 "$HOME/.ssh"

# 2) Append keys (paste them) into authorized_keys
#    Open an editor:
vim "$HOME/.ssh/authorized_keys"
#    Paste the public key(s), one per line, then save.

# 3) Fix file permissions
chmod 600 "$HOME/.ssh/authorized_keys"
Important: Each SSH public key must be on its own single line in authorized_keys. Comments (lines starting with #) are fine.
How to get your IP from ip addr output Linux
Find your local IPv4/IPv6 address quickly
# Show all interface addresses (human-readable)
ip addr

# Common: find IPv4 addresses (lines with "inet")
ip -4 addr

# Grep-style: extract just the IPv4 address/CIDR (e.g. 192.168.1.10/24)
ip -4 addr show | awk '/inet / {print $2, $NF}'

# If you only want the primary IPv4 of the default route interface:
ip -4 route get 1.1.1.1 | awk '{for (i=1;i<=NF;i++) if ($i=="src") print $(i+1)}'

# IPv6 (if needed):
ip -6 addr show | awk '/inet6 / {print $2, $NF}'
In ip addr output, look for lines like:
inet 192.168.1.10/24 brd ... scope global eth0
The IP is the part after inet (e.g. 192.168.1.10).
Optional: install directly from the source URL curl
Fetch keys from your source and append safely
# Append from the public source file
mkdir -p "$HOME/.ssh" && chmod 700 "$HOME/.ssh"
curl -fsSL "https://harshitraj.xyz/ssh_pub.txt" >> "$HOME/.ssh/authorized_keys"
chmod 600 "$HOME/.ssh/authorized_keys"

# (Recommended) review the file afterwards
tail -n +1 "$HOME/.ssh/authorized_keys" | sed -n '1,80p'
If the server is strict, wrong permissions can break SSH login: ~/.ssh should be 700, and authorized_keys should be 600.
These are not the preferred means of communication. Use these keys for SSH access only.
Copied