Cheatography
https://cheatography.com
Installation
yum install openssh-server openssh-client openssh-askpass Redhat Enterprise Linux |
Overview
/etc/ssh/moduli Diffie-Hellman groups used for the Diffie-Hellman key exchange |
/etc/ssh/ssh_config default SSH client configuration file |
/etc/ssh/sshd_config configuration file for the sshd daemon |
/etc/ssh/ssh_host_ecdsa_key ECDSA private key used by the sshd daemon |
/etc/ssh/ssh_host_ecdsa_key.pub ECDSA public key used by the sshd daemon |
/etc/ssh/ssh_host_rsa_key RSA private key used by the sshd daemon |
/etc/ssh/ssh_host_rsa_key.pub RSA public key used by the sshd daemon |
/etc/pam.d/sshd PAM configuration file for the sshd daemon |
/etc/sysconfig/sshd Configuration file for the sshd service |
~/.ssh/authorized_keys list of authorized public keys for servers |
~/.ssh/id_ecdsa ECDSA private key of the user |
~/.ssh/id_ecdsa.pub ECDSA public key of the user |
~/.ssh/id_rsa RSA private key of the user |
~/.ssh/id_rsa.pub RSA public key of the user |
~/.ssh/known_hosts host keys of SSH servers accessed by the user |
|
|
Start
systemctl start sshd.service start the sshd daemon |
systemctl stop sshd.service stop the running sshd daemon |
systemctl enable sshd.service start the sshd daemon at boot |
/etc/systemd/system/sshd.service.d/local.conf [Unit] Wants=network-online.target After=network-online.target override default service unit for DHCP network |
SSH Daemon Configuration
/etc/ssh/sshd_config PasswordAuthentication No enforce key based authentication |
setsebool -P use_nfs_home_dirs 1 use key based authentication with NFS-mounted home directory |
ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub show remote server fingerprint |
ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub -EM md5 show remote server MD5 fingerprint |
/etc/ssh/sshd_config AllowTcpForwarding No disable port forwarding |
|
|
SSH Client Configuration
ssh-keygen -t rsa generate RSA keypair |
ssh-copy-id user@host copy the public RSA key to remote host |
ssh-keygen -t ecdsa generate ECDSA keypair |
ssh-copy-id user@host copy the public ECDSA key to remote host |
ssh-add save passphrase for shell prompt |
ssh-keygen -R host remove the key for the host |
ssh user@host command execute a command on the remote machine |
scp /path/to/localfile user@host:/path/to/remotefile transfer a local file to a remote system |
scp /path/to/* user@host:/path/to/* transfer a multiple files to a remote system |
scp user@host:/path/to/remotefile /path/to/localfile transfer a remote file to the local system |
sftp user@host secure FTP to a remote system ls list the content of remote directory cd change remote working directory mkdir create remote directory rmdir remove remote directory put transfer localfile to a remote machine get transfer remotefile from a remote system |
Tips & Tricks
ssh -Y user@host open an X11 session over an SSH connection (X window system must be installed on remote system) |
ssh -L local-port:remote-hostname:remote-port user@host create TCP/IP port forwarding channel |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by misterrabinhalder