- To remove a entry from Known_hosts in .ssh directory
ssh-keygen -R hostname
ssh-keygen -F myhost # shows myhosts's line in the known_hosts file
ssh-keygen -l -F myhost # additionally shows myhost's fingerprint
ssh-keygen -R myhost # remove myhost's line from known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
To clear ACL on files:
chmod -R -a# 0 ~/.ssh
For config changes, to restart:
sudo /etc/init.d/sshd restart
Restart SSH:
invoke-rc.d ssh restart
scp $source_file $remote_user@$remote_host:$destination_file // to send scp $remote_user@$remote_host:$source_file $destination_file // to receive
Open SSH Agent
eval ssh-agent -s
Add key to Agent
ssh-add $private_key
Delete all Agent Memory:
ssh-add -l // to list ssh-add -D // to delete
Run single command on server ssh $remote_user@$remote_host 'ls *.txt'