What type of hardware are you using: Virtual machine What YunoHost version are you running: 12.1.36 stable How are you able to access your server: The webadmin
SSH
Bonjour, j’essaye de changer le port SSH par defaut 22 par un autre (22222 par exemple).
Ca ne fonctionne pas : lorsque je tape la commande yunohost specifique tout semble bien se passer mais le port ne change pas…
Auriez-vous une idée ? je me demande si proxmox n’interfere pas dans cette configuration mais je ne trouve rien de ce coté non plus.
Merci !
Share relevant logs or error messages
sushi@miniyuno:~$ cat /etc/ssh/sshd_config | grep “Port”
Port 22
sushi@miniyuno:~$ sudo yunohost settings set security.ssh.ssh_port -v 22222 --debug
21 DEBUG acquiring lock…
27 DEBUG lock has been acquired
290 DEBUG loading python module yunohost.settings took 0.262s
290 DEBUG processing action ‘yunohost.settings.set’
291 DEBUG Import and parse pre-answered options
312 DEBUG initializing root ldap interface
313 DEBUG Ask unanswered question and prevalidate data
========================================
Security
========================================
SSH
1331 INFO Saving the new configuration…
1333 SUCCESS Config updated as expected
1334 DEBUG To view the log of the operation ‘Apply settings’, use the command ‘yunohost log show 20251215-194249-settings_set’
1336 DEBUG action executed in 1.046s
1336 DEBUG lock has been released
sushi@miniyuno:~$ sudo yunohost settings get security.ssh.ssh_port --debug
267 DEBUG loading python module yunohost.settings took 0.247s
268 DEBUG processing action ‘yunohost.settings.get’
289 DEBUG initializing root ldap interface
290 DEBUG action executed in 0.022s
22222
sushi@miniyuno:~$ cat /etc/ssh/sshd_config | grep “Port”
Port 22
sushi@miniyuno:~$ sudo systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; disabled; preset: enabled)
Active: active (running) since Thu 2025-12-11 19:04:21 CET; 4 days ago
TriggeredBy: ● ssh.socket
Docs: man:sshd(8)
man:sshd_config(5)
Process: 5322 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 5324 (sshd)
Tasks: 1 (limit: 35863)
Memory: 10.0M
CPU: 2min 28.650s
CGroup: /system.slice/ssh.service
└─5324 “sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups”
tu veux dire sudo yunohost tools regen-conf ssh --dry-run --with-diff ?
ca me donne :
sushi@miniyuno:~$ sudo yunohost tools regen-conf ssh --dry-run --with-diff
Warning: The configuration file ‘/etc/ssh/sshd_config’ has been manually modified and will not be updated
ssh:
applied:
pending:
/etc/ssh/sshd_config:
diff: @@ -4,7 +4,7 @@
Protocol 2
PLEASE: if you wish to change the ssh port properly in YunoHost, use this command:
yunohost settings set security.ssh.ssh_port -v
-Port 22
+Port 22222
ListenAddress ::
ListenAddress 0.0.0.0
@@ -107,3 +107,4 @@
If the server is a VPS, it’s expected that the owner of the
server has access to a web console through which to log in.
Match Address 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,169.254.0.0/16,fe80::/10,fd00::/8
PermitRootLogin yes
status: modified
sushi@miniyuno:~$ cat /etc/ssh/sshd_config | grep "Port"
Port 22
sushi@miniyuno:~$ sudo yunohost tools regen-conf ssh --dry-run --with-diff --force
[sudo] password for sushi:
Success! The configuration would have been updated for category ‘ssh’
ssh:
applied:
/etc/ssh/sshd_config:
diff: @@ -4,7 +4,7 @@
Protocol 2
PLEASE: if you wish to change the ssh port properly in YunoHost, use this command:
yunohost settings set security.ssh.ssh_port -v
-Port 22
+Port 22222
ListenAddress ::
ListenAddress 0.0.0.0
@@ -107,3 +107,4 @@
If the server is a VPS, it’s expected that the owner of the
server has access to a web console through which to log in.
Match Address 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,169.254.0.0/16,fe80::/10,fd00::/8
PermitRootLogin yes
status: force-updated
pending:
sushi@miniyuno:~$ cat /etc/ssh/sshd_config | grep “Port”
Port 22
sushi@miniyuno:~$ sudo yunohost settings set security.ssh.ssh_port -v 22222 --debug
21 DEBUG acquiring lock…
27 DEBUG lock has been acquired
266 DEBUG loading python module yunohost.settings took 0.238s
266 DEBUG processing action ‘yunohost.settings.set’
267 DEBUG Import and parse pre-answered options
288 DEBUG initializing root ldap interface
289 DEBUG Ask unanswered question and prevalidate data
========================================
Security
========================================
SSH
1307 INFO Saving the new configuration…
1309 SUCCESS Config updated as expected
1310 DEBUG To view the log of the operation ‘Apply settings’, use the command ‘yunohost log show 20251215-223412-settings_set’
1312 DEBUG action executed in 1.046s
1312 DEBUG lock has been released
sushi@miniyuno:~$ cat /etc/ssh/sshd_config | grep “Port”
Port 22
sushi@miniyuno:~$
Car le pare-feu n’a pas été rechargé. yunohost firewall reload
Lance sudo yunohost tools regen-conf nftables fail2ban et regarde si cela renvoie qqch.
Essaie aussi systemctl restart yunohost-api, je pense que cela doit recharger -entre autres- le parefeu.
Ce que je veux dire par là, c’est que tu ne pourras pas savoir si les modifications faites fonctionnent si tu n’essaies pas la commande avec un autre port. Si 22222 est déjà enregistré partout, il est normal que tu n’aies que Success! Config updated as expected