Simple SSH Setup for Ubuntu and Linux Mint
Simple SSH Setup for Ubuntu and Linux Mint:
Most Linux distributions come with the SSH client already installed. If you want to use SSH to log into a remote machine, you will have to install the server application on that machine and make sure it's up and running.
SSH Server Setup:
Your router may not be running a local host name server. Most modern routers don't. In that case, The SSH server machine should be set with a static IP address on the local network. You should do this first before installing the server software.
You will need to know the gateway address, netmask, available IP addresses for your local network and DNS server addresses.
To find your gateway address:
ip route
The gateway is the address of your router. It should be something like 192.168.0.1.
To find you current IP address and netmask:
ifconfig
(If ifconfig is not already installed run: sudo apt install net-tools)
Your current IP4 address is prefaced with 'inet' and the netmask is listed right after it. Ex. "inet 192.168.0.11 netmask 255.255.255.0 broadcast 192.168.0.255"
You will need to set addresses for Domain Name System servers so your system can find web sites. This is usually done automatically through DHCP but we will do it manually. You can get DNS from your ISP or use an open DNS. I prefer 1.1.1.1 and 1.0.0.1. To learn more: https://www.cloudflare.com/learning/dns/what-is-1.1.1.1/
Reboot and confirm the new static IP is working properly.
Install SSH server:
sudo apt install openssh-server
Once installed, the server should automatically start itself and the machine will be waiting for logins from other machines on the network through port 22. Be sure to allow traffic on port 22 through any firewalls.
First Login:
ssh 192.168.0.20
You must type in "yes" and provide the password for the account you're logging into on the remote machine.
Use SFTP:
sftp 192.168.0.20
SFTP works very much like FTP but uses a secure SSH connection.
To make login a little easier use this script or set the command as an alias:
#!/bin/bash
# SSH login shorthand command: "sshin (last two digits of IP)"
ssh -X 192.168.0."$1"
The -X option turns on X forwarding.
Use SSH Keys:
Keys make for grater security and automate login. There are many options and ways to work with SSH keys. This is a very simplified way to get started with SSH keys.
Generate keys on cleat machine:
ssh-keygen
Accept the default file name and path. For passphrase, just press enter.
Confirm key creation with:
ll .ssh
Copy public key to server:
ssh-copy-id joe@192.168.0.20
You may now login automatically. You might consider turning off password access to the server to make it more secure. Don't copy you personal ssh key (id_rsa) to the server unless you intend to log into other machines on your local network from that machine. You should never put your private key on servers running on the public internet.
Use SSHFS:
To take advantage of secure file sharing through SSH, you'll need to have the SSHFS client installed on the client machines. Install it on the server if that machine will also be an ssh client
sudo apt install sshfs
Access files on remote machines:
sshfs (user@)host:(dir) mountpoint (options)
Ex. sshfs 192.168.0.20:Documents/ Shared-Documents/ -o reconnect
Add a command like this to your startup applications or put several in a script to setup secure file sharing automatically.
Check out https://www.ezeelinux.com for more about Linux.
Please join the discussion at EzeeTalk.
https://www.ezeelinux.com/talk/ It's free, secure and fun!
Видео Simple SSH Setup for Ubuntu and Linux Mint канала Joe Collins
Most Linux distributions come with the SSH client already installed. If you want to use SSH to log into a remote machine, you will have to install the server application on that machine and make sure it's up and running.
SSH Server Setup:
Your router may not be running a local host name server. Most modern routers don't. In that case, The SSH server machine should be set with a static IP address on the local network. You should do this first before installing the server software.
You will need to know the gateway address, netmask, available IP addresses for your local network and DNS server addresses.
To find your gateway address:
ip route
The gateway is the address of your router. It should be something like 192.168.0.1.
To find you current IP address and netmask:
ifconfig
(If ifconfig is not already installed run: sudo apt install net-tools)
Your current IP4 address is prefaced with 'inet' and the netmask is listed right after it. Ex. "inet 192.168.0.11 netmask 255.255.255.0 broadcast 192.168.0.255"
You will need to set addresses for Domain Name System servers so your system can find web sites. This is usually done automatically through DHCP but we will do it manually. You can get DNS from your ISP or use an open DNS. I prefer 1.1.1.1 and 1.0.0.1. To learn more: https://www.cloudflare.com/learning/dns/what-is-1.1.1.1/
Reboot and confirm the new static IP is working properly.
Install SSH server:
sudo apt install openssh-server
Once installed, the server should automatically start itself and the machine will be waiting for logins from other machines on the network through port 22. Be sure to allow traffic on port 22 through any firewalls.
First Login:
ssh 192.168.0.20
You must type in "yes" and provide the password for the account you're logging into on the remote machine.
Use SFTP:
sftp 192.168.0.20
SFTP works very much like FTP but uses a secure SSH connection.
To make login a little easier use this script or set the command as an alias:
#!/bin/bash
# SSH login shorthand command: "sshin (last two digits of IP)"
ssh -X 192.168.0."$1"
The -X option turns on X forwarding.
Use SSH Keys:
Keys make for grater security and automate login. There are many options and ways to work with SSH keys. This is a very simplified way to get started with SSH keys.
Generate keys on cleat machine:
ssh-keygen
Accept the default file name and path. For passphrase, just press enter.
Confirm key creation with:
ll .ssh
Copy public key to server:
ssh-copy-id joe@192.168.0.20
You may now login automatically. You might consider turning off password access to the server to make it more secure. Don't copy you personal ssh key (id_rsa) to the server unless you intend to log into other machines on your local network from that machine. You should never put your private key on servers running on the public internet.
Use SSHFS:
To take advantage of secure file sharing through SSH, you'll need to have the SSHFS client installed on the client machines. Install it on the server if that machine will also be an ssh client
sudo apt install sshfs
Access files on remote machines:
sshfs (user@)host:(dir) mountpoint (options)
Ex. sshfs 192.168.0.20:Documents/ Shared-Documents/ -o reconnect
Add a command like this to your startup applications or put several in a script to setup secure file sharing automatically.
Check out https://www.ezeelinux.com for more about Linux.
Please join the discussion at EzeeTalk.
https://www.ezeelinux.com/talk/ It's free, secure and fun!
Видео Simple SSH Setup for Ubuntu and Linux Mint канала Joe Collins
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![OpenSSH Full Guide - Everything you need to get started!](https://i.ytimg.com/vi/YS5Zh7KExvE/default.jpg)
![Introducing BU | A simple USB BackUp tool for Debian, Ubuntu and Linux Mint](https://i.ytimg.com/vi/oZvAQYh20KU/default.jpg)
![Linux Distro Hopping Tips and Tricks](https://i.ytimg.com/vi/b_RPyMW-78Y/default.jpg)
![](https://i.ytimg.com/vi/H5e61C_FA6I/default.jpg)
![EzeeLinux FAQ](https://i.ytimg.com/vi/sAGWMutbwmk/default.jpg)
![EzeeLinux Show 18.17 | Care and Feeding of your SSD](https://i.ytimg.com/vi/XcLnk-o7JIo/default.jpg)
![SSH Crash Course | With Some DevOps](https://i.ytimg.com/vi/hQWRp-FdTpc/default.jpg)
![16 Linux Tips in 10 Minutes](https://i.ytimg.com/vi/ypWaj4Qxj1k/default.jpg)
![JC's Favorite Terminal Tools](https://i.ytimg.com/vi/w6WG10ULTuQ/default.jpg)
![Upgrading to Linux Mint 19.2 "Tina"](https://i.ytimg.com/vi/ylVFZdzOhoE/default.jpg)
![Up Gets an Update | Removing Old Kernel Config Files from Ubuntu](https://i.ytimg.com/vi/tvW_PE_pRBM/default.jpg)
![Linux Talk | Working with Drives and Filesystems](https://i.ytimg.com/vi/JBRFEvsvQPQ/default.jpg)
![Enabling A Firewall Is Easy In Linux](https://i.ytimg.com/vi/JzpdC-4BEo0/default.jpg)
![How To Generate Ed25519 SSH Keys, Install Them, and Configure Secure Passwordless Authentication](https://i.ytimg.com/vi/vINn1MIrf7o/default.jpg)
![My Frustration with Linux Prognostication](https://i.ytimg.com/vi/p2mHDit3XlM/default.jpg)
![How to Create .deb Packages for Debian, Ubuntu and Linux Mint](https://i.ytimg.com/vi/ep88vVfzDAo/default.jpg)
![Nextcloud: Complete Setup Guide](https://i.ytimg.com/vi/y4dtcr2NL5M/default.jpg)
![Stop Hating On Linux Mint!](https://i.ytimg.com/vi/szDHAeaqJD8/default.jpg)
![Minimalist vs Modern - Linux Mint 20.1](https://i.ytimg.com/vi/HeJe6l_fmbE/default.jpg)
![My 5 Favorite Linux Shell Tricks for SPEEEEEED (and efficiency)](https://i.ytimg.com/vi/V8EUdia_kOE/default.jpg)