to not have to specify many options on the command-line, you can set the default user, port and more in the file ~/.ssh/config
Host testhost Port 321 User testuser IdentityFile ~/.ssh/private-key
mount a remote directory with sshfs
sshfs somehost:/ /mnt/somedirectory
or use "sftp" which can work interactively
sftp -P 22 someuser@somehost:/
the port option is an uppercase p unlike with the ssh command where it is lowercase or use "scp"
you need a private\public key pair. private keys in general can have an additional password themselves to protect the key. use ssh-copy-id, or append the contents of the public key you want to use to the file ~/.ssh/authorised_keys on the server. then configure ssh to use the key with IdentityFile option in .ssh/config or specify the path with a command-line option
ssh-keygen -t rsa
password can be empty, target is typically ~/.ssh/keyname
chmod 400 ~/.ssh/keyname*
ssh displays an error if the permissions are not limited enough
ssh-copy-id comes bundled with openssh
ssh-copy-id -i ~/.ssh/keyname someuser@somehost
append all contents of the file keyname.pub to the file .ssh/authorized_keys on the server. create the file or directory if it does not exist
in ~/.ssh/config
Host testserver IdentityFile ~/.ssh/keyname
ssh -i ~/.ssh/keyname testserver
echo "command-string" | ssh hostname
stop the sshd service. this normally does not close active connections
systemctl stop sshd
start sshd with debugging output
/usr/bin/sshd -d
the full path with /usr/bin is required or ssh will say so and exit make connections and see the debug output displayed. to finish, exit with ctrl+c and do not forget to start the original sshd service again
systemctl start sshd