Last active
March 30, 2022 17:31
-
-
Save 1901/de89d95a5832fc92e5fb93a4c5f0fb49 to your computer and use it in GitHub Desktop.
[SSH commands] #ssh #linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ssh to host | |
ssh user@hostname | |
# generate ssh key | |
ssh-keygen -t rsa -C "[email protected]" | |
# copy local ssh public key to remote host | |
ssh-copy-id user@hostname | |
# add private key to ssh-agent | |
ssh-add ~/.ssh/id_rsa_github | |
# remove hostname from known_hosts list | |
ssh-keygen -f ~/.ssh/known_hosts -R hostname | |
# Mount remote directory | |
sshfs user@hostname:remote_directory mountpoint | |
# Unmount remote directory | |
umount mountpoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment