ssh
Secure shell
Looks and acts the same as a telnet but it’s encrypted
To checkot the config use
Example Client config
Key-gen
[!bug] Rember about Permissions Wsl grants all the permison to a file that may casue issue becouse ssh will claim thas insecure
The the permisons shoudl be
0400
SSH Tunnels/Por forwarding
# -N to only mentaine the proxy not interactable
# -f run in the backgorund
#ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT [USER@]SSH_SERVER
ssh -L 5901:localhost:6969 -N -f user@remote.host
Deufalt message
To cusotmise your ssh message use /etc/motd
- Custom scripts can be found insider
/etc/update-motd.d
Ssh options
PortDefinesthe TCP listening port.PermitRootLoginIndicateswhether to allow or disallow root login.MaxAuthTriesSpecifiesthe maximum number of authentication tries. Afterreaching half of this number, failures are logged to syslog.MaxSessionsIndicatesthe maximum number of sessions that can be open fromone IP address.AllowUsersSpecifiesa space-separated list of users who are allowed to connectto the server.PasswordAuthenticationSpecifieswhether to allow password authentication. This option ison by default.TCPKeepAliveSpecifieswhether or not to clean up inactive TCP connections.ClientAliveIntervalSpecifiesthe interval, in seconds, that packets are sent to the client to figure out if the client is still alive.ClientAliveCountMaxSpecifiesthe number of client alive packets that need to be sent.UseDNSIfon, uses DNS name lookup to match incoming IP addresses to names.ServerAliveIntervalSpecifiesthe interval, in seconds, at which a client sends a packet toServerAliveCountMaxSpecifiesthe maximum number of packets a client sends to a server
Caching the ssh passphrases
- Type ssh-agent /bin/bash to start the agent for the current (Bash) shell.
- Type ssh-add to add the passphrase for the current user’s private key. The key is now cached.
- Connect to the remote server. Notice that there is no longer a need to enter the passphrase.