ubuntu:ssh:install_ssh
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ubuntu:ssh:install_ssh [2019/12/04 21:25] – created peter | ubuntu:ssh:install_ssh [2025/05/21 09:26] (current) – peter | ||
---|---|---|---|
Line 2: | Line 2: | ||
<code bash> | <code bash> | ||
- | sudo apt install | + | sudo apt install |
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Verify that SSH is running ===== | ||
+ | |||
+ | <code bash> | ||
+ | sudo systemctl status ssh | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | ● ssh.service - OpenBSD Secure Shell server | ||
+ | | ||
+ | | ||
+ | Docs: man:sshd(8) | ||
+ | | ||
+ | Main PID: 885 (sshd) | ||
+ | Tasks: 1 (limit: 9403) | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Nov 19 09:47:32 plex systemd[1]: Starting OpenBSD Secure Shell server... | ||
+ | Nov 19 09:47:32 plex sshd[885]: Server listening on 0.0.0.0 port 22. | ||
+ | Nov 19 09:47:32 plex sshd[885]: Server listening on :: port 22. | ||
+ | Nov 19 09:47:32 plex systemd[1]: Started OpenBSD Secure Shell server. | ||
+ | Nov 19 09:48:15 plex sshd[1358]: Accepted password for peter from 192.168.1.69 port 49974 ssh2 | ||
+ | Nov 19 09:48:15 plex sshd[1358]: pam_unix(sshd: | ||
+ | Nov 21 21:24:44 plex sshd[83478]: | ||
+ | Nov 21 21:24:44 plex sshd[83478]: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Start the SSH Service ===== | ||
+ | |||
+ | If the service is not running, start it: | ||
+ | |||
+ | <code bash> | ||
+ | sudo systemctl start ssh | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Enable SSH Service to Start on Boot ===== | ||
+ | |||
+ | To ensure that the SSH service automatically starts after a reboot, you need to enable it using systemctl. | ||
+ | |||
+ | <code bash> | ||
+ | sudo systemctl enable ssh | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Firewall - Open the SSH port ===== | ||
+ | |||
+ | <code bash> | ||
+ | sudo ufw allow ssh | ||
+ | sudo ufw enable | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Test ===== | ||
+ | |||
+ | From a remote system, try to connect to this system using SSH: | ||
+ | |||
+ | <code bash> | ||
+ | ssh username@server_ip_OR_hostname | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== TAGS ===== | ||
+ | |||
+ | * TAG: Networking | ||
+ | * TAG: Security | ||
+ | * TAG: Server | ||
+ | * TAG: SSH | ||
+ | |||
ubuntu/ssh/install_ssh.1575494706.txt.gz · Last modified: 2020/07/15 09:30 (external edit)