Koozali.org: home of the SME Server

SSH_Config und Denyhosts

Offline lancelott2

  • *
  • 73
  • +0/-0
  • Ich bin Lancelott2
    • Meine private Homepage
SSH_Config und Denyhosts
« 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!
---------------------------------------------------------------------
Auch ich lerne noch ständig dazu!
---------------------------------------------------------------------

guest22

Re: SSH_Config und Denyhosts
« Reply #1 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?

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: SSH_Config und Denyhosts
« Reply #2 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..

Offline lancelott2

  • *
  • 73
  • +0/-0
  • Ich bin Lancelott2
    • Meine private Homepage
Re: SSH_Config und Denyhosts
« Reply #3 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 ;)
---------------------------------------------------------------------
Auch ich lerne noch ständig dazu!
---------------------------------------------------------------------

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: SSH_Config und Denyhosts
« Reply #4 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

Offline lancelott2

  • *
  • 73
  • +0/-0
  • Ich bin Lancelott2
    • Meine private Homepage
Re: SSH_Config und Denyhosts
« Reply #5 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


---------------------------------------------------------------------
Auch ich lerne noch ständig dazu!
---------------------------------------------------------------------

guest22

Re: SSH_Config und Denyhosts
« Reply #6 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.

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: SSH_Config und Denyhosts
« Reply #7 on: March 01, 2017, 10:04:54 PM »
sshd port can be set via server-manager, even easier :-)

Offline lancelott2

  • *
  • 73
  • +0/-0
  • Ich bin Lancelott2
    • Meine private Homepage
Re: SSH_Config und Denyhosts
« Reply #8 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

« Last Edit: March 02, 2017, 01:21:42 PM by lancelott2 »
---------------------------------------------------------------------
Auch ich lerne noch ständig dazu!
---------------------------------------------------------------------

guest22

Re: SSH_Config und Denyhosts
« Reply #9 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.

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: SSH_Config und Denyhosts
« Reply #10 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
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation