grep -i ssh /etc/services
# ftp: 20, 21
# telnet: 23
apt-get install openssh-client
ls -l /usr/bin/slogin
ssh 192.168.56.4 # same user as we logged in with, user@host$
ssh milad@192.168.56.4 ls -l .ssh # issue command without connecting into the remote machine
nano .ssh/config
cat .ssh/known_hosts | head -1
ssh localhost # will give you the fingerprint of localhost
# Gather ssh public keys
ssh-keyscan -t ecdsa localhost
ssh-keyscan -t ecdsa 192.168.56.4
cat /etc/ssh/ssh_host_ecdsa_key.pub # same as ssh-keyscan -t ecdsa localhost
ssh-keyscan -t ecdsa localhost > ssh.ecdsa 2> /dev/null
ssh-keygen -lf ssh.ecdsa
ssh
ssh -o FingerprintHash=md5
ssh-keygen -t rsa -b 4096 -C 'milad@tuxgeek.ir' -P '1234'
# RSA> min: 1024 - default: 2048
# DSA> 1024 Exact
ssh-copy-id root@srv1
ssh-copy-id root@192.168.56.4
ssh-copy-id 192.168.56.4 # same as user we logged in
ssh-copy-id -i new_rsa milad@srv1
Default behaviour without -i, is to check if ‘ssh-add -L’
If there was no key in agent then:
The default_ID_file is the most recent file that matches: ~/.ssh/id*.pub
Just use touch(1) on your preferred key's .pub file to rein‐state it as the most recent.
ssh srv1 cat .ssh/authorized_keys
exec dbus-launch --sh-syntax --exit-with-session ssh-agent openbox-session
# or login managers like lightdm
ssh-agent bash
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
ssh-add:
ssh root@srv1 cat /etc/ssh/sshd_config
systemctl restart sshd.service
scp /etc/hosts srv1:/tmp/hosts
scp root@192.168.56.4:/tmp/ze /tmp
sftp root@srv1
mkdir
get -p remoteFile [localPath]
put -p localFile [remotePath]
lls
The practical effect of this is that the end user can seamlessly interact with remote
files being securely served over SSH just as if they were local files on his/her computer.
sshfs pc101:/home/milad/ mnt/
fusermount -u ~/mnt
ipynb
format: https://github.com/ravexina/linux-notes. html
exports of project available at: https://ravexina.github.io/linux-notes.Linux Notes by Milad As (Ravexina) is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.