LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-04-2009, 10:06 AM   #1
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
how to keep an ssh mounted folder alive and connected.


Hey all,

I am working on a remote server computer from home. What i usually do to edit files is use an ssh connection to use vim on the remote box etc..

now, if i just ssh in, if there is a few moments of inactivity, i will be cut off and have to log in again (the drop may be from my ISP ) . Anyway, i have noticed if i start gnu screen on the remote computer, the connection will last.

I have been wanting to use sshfs to mount a remote folder, but do not want it kicked off.

My question: what is it about screen that keeps it's connection alive, and is there a way i can use that on an ssh mounted remote folder?
thanks for any tips.
 
Old 01-04-2009, 12:18 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
i have noticed if i start gnu screen on the remote computer, the connection will last.
I think it is not the connection that is "lasting", it is the session

If you ssh to a normal shell and run some processes, and the connection is dropped (maybe by your ISP) then you will be logged out and all your processes will be killed.

But by running screen your processes started within screen will be kept alive until you next re-establish the ssh connection.
That is what screen is for.

[Off Topic]
One of my servers starts a vnc server on display:1 at boot time.
I can log in remotely and start a GUI session on the server (but displayed locally) with vncviewer servername:1

If I close the vncviewer window on my local machine, the vncserver is still running on the server, and I can reconnect to it with vncviewer servername:1 All my windows, applications etc. are just as I left them. Very useful.
[/Off Topic]

Quote:
I have been wanting to use sshfs to mount a remote folder, but do not want it kicked off.
You probably won't be "kicked off", the remote directory will probably reappear when the connection is re-established. You can test this behaviour yourself (pull your ethernet cable - the directory becomes inaccessible, reconnect it, wait a minute or so, does it reappear?)

If this isn't the case, you could set up a cron job to test (every few minutes?) if the remote directory is available. If not, an attempt could be made to remount it.
 
Old 01-04-2009, 12:24 PM   #3
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Original Poster
Rep: Reputation: 30
thanks for the help,
will test it out some when i get back to the house.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Keeping your SSH connections alive with autossh LXer Syndicated Linux News 0 05-16-2008 09:30 PM
problem with mounted folder texuser74 Linux - Newbie 9 02-04-2008 08:34 PM
Keep-alive for SSH on wireless connection? x_terminat_or_3 Linux - Software 4 04-24-2007 05:24 PM
Documents Folder Mounted BarfBag Ubuntu 0 03-09-2006 12:44 PM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 02:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration