Security Stuff!!
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode

Configuring SSH

SSH key generator

generate keys by command ssh-keygen -t rsa and then follow the default configuration.

Generating public/private rsa key pair.  
Enter file in which to save the key (/home/example/.ssh/id\_rsa):  
Created directory '/home/example/.ssh'.  
Enter passphrase (empty for no passphrase):  
Enter same passphrase again:  
Your identification has been saved in /home/example/.ssh/id\_rsa.  
Your public key has been saved in /home/example/.ssh/id\  
The key fingerprint is:  
5e:3f:6f:57:42:d0:b2:f5:aa:98:53:0f:20:5d:b0:2a example@example

it will generates 2 files in ~/.ssh (id_rsa and id_rsa : it’s a private key ,should be protected. : it’s a public key

Installing public key

you can use command ssh-copy-id to copy the public key to another computer, or you can also use scp to copy the public key.

server trust a client

if server trust a client to access to SSH server without password (passwordless log-in).
1-server copy client’s public key to ~/.ssh/ ssh-copy-id or scp
2-change public key name into authorized_keys.
3- change it’s permission into 600 chmod 600 authorized_keys

x11 session forwarding

To allow to run some X window programs such as Firefox on a remote computer.

edit sshd_config nano /etc/ssh/sshd_config   and check these options
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Then connect to remote computer by command ssh -X username@server

Securing SSH

don’t allow root login edit sshd_config nano/etc/ssh/sshd_config you will find #PermitRootLogin yes uncomment it and change it to no PermitRootLogin no

TCP Wrapper

Add SSHD to TCP Wrapper to allow and deny hosts to connect to SSHD  edit /etc/hosts.allow or /etc/hosts.deny
to deny host to connect to SSH server
nano /etc/hosts.deny
sshd :