ssh-keygen -t ed25519 -C "laptop" # creates ~/.ssh/id_ed25519 and .pub
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server
ssh user@server
If you cannot use ssh-copy-id, append the public key to ~/.ssh/authorized_keys on the server (mode 600; the .ssh directory 700).
# ~/.ssh/config
Host myserver
HostName server.example.org
User ubuntu
Port 2222
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
Then ssh myserver, scp file myserver:~/ and rsync -av dir/ myserver:dir/ all work with the alias. Protect the private key with a passphrase and ssh-agent. Never copy a private key to a server or paste it anywhere.