Help - Search - Members - Calendar
Full Version: How To Increase SSH Conection Time
The Planet Forums > System Administration > HOWTOs
GetBackers
Hello,

After a certain amount of idle time the connection to my server via SSH closes. I'm currently trying to move a large folder to another folder, but I can't complete it because of this problem. So, how do I increase the connection time? I have Redhat Enterprise Linux and working under Linux Rescue Environment.

Regards
Catalyst
QUOTE (GetBackers @ Oct 22 2008, 10:08 AM) *
After a certain amount of idle time the connection to my server via SSH closes. I'm currently trying to move a large folder to another folder, but I can't complete it because of this problem. So, how do I increase the connection time? I have Redhat Enterprise Linux and working under Linux Rescue Environment.
I don't think there *is* one, but check /etc/ssh/sshd_config for the `IdleTimeOut` line. You can set it in seconds, minutes, hours, days, etc. with 4s, 4m, 4h, 4d, etc. or delete the line entirely. Of course, restart the sshd service after --- stay connected, restart it, log in with a new session, and exit the old one.

Problem is, like I said, I don't think there is one. There isn't by default. It's more likely an issue with your ISP.
GetBackers
Thanks for the reply.

I will have to check if it is my ISP. I have been trying out different commands, and SSH only times out with mv, such as if I tar a file that takes hours to tar, it doesn't time out. So does mv tell my connection that it's idle, while tar tells that it's active?

I am using SSH Secure Shell. What does green highlighted files with an asterisk next to it mean? I need to know because I am trying to restart ssh service by doing /sbin/service sshd reload, but it doesn't work because service is green with an asterisk, and gives me the " No such file or directory" error.



Edit

Well forget about the sshd commands. The reason why some stuff isn't working is because of the Linux Rescue Environment. This isn't good because I need my directories moved, and downloading the files isn't optional because the server hasn't let me connect to it with FTP for more than a few seconds since Sunday. sad.gif
Tomy Durden
In /etc/ssh/sshd_config define the following
CODE
ClientAliveInterval 60
ClientAliveCountMax 120


The server will check with the client every 60 seconds and after 120 unsuccessful checks the server will disconnect the client.

Also, keep in mind that if your client dies or gets disconnected, the socket could remain open for the length of the total timeout(120 minutes). Generally, this isn't a problem unless you limit the amount of connections or resource usage is a bit high.


And, if you have screen installed, you could run the commands and they'll keep going if the terminal is lost or you hit CTRL+A+D and disconnect. You can reconnect and type screen -r to pull the session up.
Martyn Dale
<3 screens

defiantly use them for any longer operation, especially when connectivity is a problem for you
GetBackers
Thanks for the help.

Like I said the SSH stuff doesn't work. I don't know if it's because I'm in Linux Rescue Environment or what. I can't work out of Linux Rescue Environment to test because the hard drive doesn't work to well.

FTP is worse off. I set my FTP client to constantly reconnect to the server because the server constantly kicks me off. Connecting to the server takes awhile and viewing each directory takes even longer. So far, most of the files are downloading, and I can just manually try to download the ones that didn't download or are incomplete. The big realization though is to re upload this stuff will take days or weeks. It would be nice if my upload speed was the same as my download.

I might try to find someone who can do the mv command for me. I tried asking The Planet, but they want $150 just to do that. I need someone to do that for a lot cheaper because I'm not asking to fix errors or anything that takes a lot of work. I just want someone who does the mv command and if it doesn't work, then it doesn't work.

I guess I should get money for a backup server that constantly backs up stuff for me. If none of this work out it won't be a big loss to me. I constantly backup my important stuff, but it just frustrates me how I can't move some of my folders.
Catalyst
Why are you using the rescue environment exactly? What's the problem with just booting up the server and having at it?
GetBackers
My hard drive is dying. If I boot with out it, then I can't connect to the server. The Planet says it's the only way I can access my server.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.