Changing a line in sshd_config

Status
Not open for further replies.

achianese

Dabbler
Joined
Oct 25, 2013
Messages
20
Hi,

I'm using unison to synchronize files between my Windows client and FreeNAS server running 9.2.0. Things are working great, except that when I try to synchronize very large folders I get a lost connection error. After some searching and experimenting, I've found that sshd on the server is closing the connection. Here's what happens:

1) Unison client on Windows initiates an ssh session. The client and server both start comparing the folder to be synced with its previous version, looking for changes. This is done locally, unlike rsync.

2) When both are done, the lists of changes are compared over ssh, changes are reconciled, and updates are made to the files.

The problem I'm encountering is that the client takes a long time to do the comparison (several minutes or hours, depending), and the server does it in a few seconds (might it be too lightning-fast?). If the client finishes a minute or more later than the server, the ssh connection is lost.

This can be fixed by changing ClientAliveInterval and/or ClientAliveCountMax in sshd, such that (number of tries) * (interval) is greater than the time unison takes to analyze the folder on the client. I've gotten this to work by manually editing /etc/ssh/sshd_config, increasing ClientAliveCountMax from the default of 3 to a larger number, then restarting sshd from the command line using "service sshd restart".

However, as I understand it, changes I make manually to sshd_config will not survive a reboot. I've tried adding "ClientAliveCountMax 100" to the Extra Options box under Services - SSH in the GUI. This appends the line to the end of sshd_config, but the original line "ClientAliveCountMax 3" is still there, and it seems to take precedence.

Does anyone have any thoughts on this? Is there a permanent way to change default options in sshd_config via the GUI if the line is already in the config file and the parameter is not included in the GUI?

Note: somebody asked a similar question here for an older version.

http://forums.freenas.org/index.php?threads/sshd_config-tweaking.10428/#post-46828
 
D

dlavigne

Guest
I've tried adding "ClientAliveCountMax 100" to the Extra Options box under Services - SSH in the GUI. This appends the line to the end of sshd_config, but the original line "ClientAliveCountMax 3" is still there, and it seems to take precedence.

If that is the case, create a bug at bugs.freenas.org and post the issue number here.
 
Status
Not open for further replies.
Top