Last active
May 25, 2024 11:02
-
-
Save mano8/a6e2d3ac28d02fbbca47eb0372b4ad76 to your computer and use it in GitHub Desktop.
Revisions
-
mano8 revised this gist
Dec 1, 2022 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,6 +21,15 @@ As an exception, if more than one ListenAddress setting is declared, the configuration is not migrated because systemd’s ListenStream has different semantics: any address configured which is not present at boot time would cause the ssh.socket unit to not start. So to change ssh port: ```# sudo sudo nano /lib/systemd/system/ssh.socket``` #Change the following parameter to the port of your choice e.g. 44022 ListenStream=44022 #save the file and quit nano editor. ```# sudo systemctl daemon-reload``` ```# sudo systemctl restart ssh``` ```# sudo netstat -tulpn``` see: - [original source](https://discourse.ubuntu.com/t/sshd-now-uses-socket-based-activation-ubuntu-22-10-and-later/30189) - [other source](https://askubuntu.com/questions/1439461/ssh-default-port-not-changing-ubuntu-22-10) -
mano8 renamed this gist
Dec 1, 2022 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,4 +21,6 @@ As an exception, if more than one ListenAddress setting is declared, the configuration is not migrated because systemd’s ListenStream has different semantics: any address configured which is not present at boot time would cause the ssh.socket unit to not start. see: - [original source](https://discourse.ubuntu.com/t/sshd-now-uses-socket-based-activation-ubuntu-22-10-and-later/30189) - [other source](https://askubuntu.com/questions/928191/how-to-open-a-closed-port-in-ubuntu) -
mano8 created this gist
Dec 1, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ # Install ssh-server ```# sudo apt-get update``` ```# sudo apt-get install openssh-server``` See status: ```# sudo systemctl status ssh``` Backup the ssh configuration: ```# sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config_backup``` configure the ssh server: ```# sudo nano /etc/ssh/sshd_config``` **Warning** On ubuntu 22.10 SSHd now uses socket-based activation. On upgrades from Ubuntu 22.04 LTS, users who had configured Port settings or a ListenAddress setting in /etc/ssh/sshd_config will find these settings migrated to /etc/systemd/system/ssh.socket.d/addresses.conf. As an exception, if more than one ListenAddress setting is declared, the configuration is not migrated because systemd’s ListenStream has different semantics: any address configured which is not present at boot time would cause the ssh.socket unit to not start. see: (original source)[https://discourse.ubuntu.com/t/sshd-now-uses-socket-based-activation-ubuntu-22-10-and-later/30189]