Koozali.org formerly Contribs.org

Other Languages => Deutsch => Topic started by: lancelott2 on February 28, 2017, 07:01:14 PM

Title: SSH_Config und Denyhosts
Post by: lancelott2 on February 28, 2017, 07:01:14 PM
Hallo,

ich habe versucht den Port in der SSH_config auf den eingestellten Port 22xx umzustellen.

Leider funktioniert das Folgende nicht:

db configuration setprop sshd TCPPort 2268
signal-event remoteaccess-update

Auch das Kopieren der Templates-Custom hat nicht funktioniert.

Deshalb nun meine Frage, wie kann ich den Port in der Datei SSH_config ändern?
und macht man das überhaupt noch?

Grüße und vorab Danke!
Title: Re: SSH_Config und Denyhosts
Post by: guest22 on March 01, 2017, 08:05:20 AM
Did you try 'service sshd restart' after changing the port with the db command so the ssh daemon picks up on the new configuration?
Title: Re: SSH_Config und Denyhosts
Post by: Stefano on March 01, 2017, 10:47:56 AM
Did you try 'service sshd restart' after changing the port with the db command so the ssh daemon picks up on the new configuration?

it should be executed during the remoteaccess-update event..
Title: Re: SSH_Config und Denyhosts
Post by: lancelott2 on March 01, 2017, 03:18:25 PM
Aktually i dont know how i have to copy the config-files into the config-custom folder, because if i use the directory, it doesnt work, and it doesnt take over the new settings.

For the normal copy of the folder i tryed both of it.

But maybe you can tell me how i must copy the template, then i can try it again.


Thanks a lot ;)
Title: Re: SSH_Config und Denyhosts
Post by: Stefano on March 01, 2017, 06:07:39 PM
Lancellot2, since you can write in english, would you mind to open a new topic in SME9.X section explaining the thing?

thank you
Title: Re: SSH_Config und Denyhosts
Post by: lancelott2 on March 01, 2017, 08:41:30 PM
Oh, i allready found the fault i did ....

I tryed before ... expand-template /etc/ssh_config ... doesnt work - cos of the subfolders ...

now i tryed ... expand-template /etc/ssh/ssh_config

and it worked .... :D


Title: Re: SSH_Config und Denyhosts
Post by: guest22 on March 01, 2017, 09:33:53 PM
Still I do not understand why you need a custom template fragment. It should work as simple as changing the port via the db command and signal-event remotate-access update.
Title: Re: SSH_Config und Denyhosts
Post by: Stefano on March 01, 2017, 10:04:54 PM
sshd port can be set via server-manager, even easier :-)
Title: Re: SSH_Config und Denyhosts
Post by: lancelott2 on March 02, 2017, 01:02:34 PM
Setting the Port up works, the Port work for SSH ...
but in the Config-File it doesnt change, there is still 22 till you change the the Template-File.

I tryed also,

db configuration setprop sshd TCPPort 22xx
signal-event remoteaccess-update

but it didnt effect the config file ... finaly i copyed and changed the templates

nano /etc/e-smith/templates-custom/etc/ssh/ssh_config/10Port
nano /etc/e-smith/templates-custom/etc/ssh/sshd_config/10Port

And expand them with
expand-template /etc/ssh/ssh_config

and that worked and changed the port in the config file :)

I changed it for Denyhosts SSH

Title: Re: SSH_Config und Denyhosts
Post by: guest22 on March 02, 2017, 01:10:28 PM
Something is odd.... the /etc/ssh/ssh_config does not get updated/expanded when changing the ssh port in server manager.
Title: Re: SSH_Config und Denyhosts
Post by: ReetP on March 02, 2017, 01:22:44 PM
Something is odd.... the /etc/ssh/ssh_config does not get updated/expanded when changing the ssh port in server manager.

It shouldn't as it has nothing to do with sshd.

It sets defaults for ssh connections going out.

https://linux.die.net/man/5/ssh_config