Sshfs reconnect

SSHFS: Mounting a remote file system over SSH

By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. It only takes a minute to sign up. I have a remote sshfs drive that I use on a daily basis. I previously executed the following command every time I booted up my computer. Obviously, it's not super convenient to do that by hand every time, so I thought I'd just add the remote to my file systems table. Unfortunately, if there is a blip in the network, the drive sometimes goes down. This happens maybe once per day -- and when I try to manually reconnect by clicking on the drive in nautilusI'm given a message that says "Transport endpoint is not connected. My primary question is this: how can I bring the -o reconnect option that I used in the terminal command into my fstab file? I believe that would prevent the drive disconnect due to blips. Also, I chose that cipher because it's the quickest one my remote server supports I thinkand removed compression because the wired gigabit network is faster than the time taken by the CPU to compress stuff. It would be great if I could pull those options into my fstab as well, but I can live without them. To include the options you want, you should modify your fstab entry as shown below. Be careful, as adding an option that doesn't actually exist will cause your system not to boot. I took the liberty of adding the noauto option. This requests that the mount won't happen automatically, so that any failure will not stop the boot process particularly when using systemd. It relies on you having a convenient way of running mount. Hopefully your filemanager will provide this, otherwise it defeats the point Another possibility is the nofail option. This option requests a successful boot even if this filesystem fails to mount "this device if it does not exist". Ironically, using the nofail option here will guarantee failure. It is formatted as a comma-separated list of options. It contains at least the type of mount ro or rwplus any additional options appropriate to the filesystem type including performance-tuning options. For details, see mount 8 or swapon 8. Options which are completely filesystem-independent are handled by fstab. Other options are passed to the filesystem-specific command in this case, sshfs. Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. Force reconnect on sshfs drive mounted via fstab Ask Question. Asked 4 years, 8 months ago. Active 1 year, 2 months ago. Viewed 6k times. Rui F Ribeiro Woodrow Barlow Woodrow Barlow 1 1 silver badge 15 15 bronze badges. So the command that you reference at the top of your post that you have to manually enter does the trick as far as you're concerned - with the obvious point that you have to retype it every time you boot? NOTE arcfour is no longer considered "safe".

SSHFS: Mounting a remote file system over SSH


By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. It only takes a minute to sign up. I have several directories mounted through sshfs. I sometimes get disconnects from the server not configurable by me. I usually mount the directories like this. The mount is still visible when typing mount. When I type. Is there a better way to deal with this? Obviously sshfs should do the umount and clean up Ideally it would reconnect automatically. You can run sshfs with the "reconnect" option. We use -o reconnect as parameter for sshfs, mostly because our users suspended their computers and on wake sshfs would not reconnect or respond, or anything. Just a note, if the remote computer is really down, sshfs may become unresponsive for a long time. This can be worked around by decreasing the timeout. I have a server that I use for storage and for some lack of space where I live, I keep it in another location. In order to bring the files into my network I use a raspberry pi that mount the files from the server using sshfs. Recently I had to upgrade to raspbian jessie due to a power failure and realised that sshfs become seriously unstable. The folders would be properly mounted but after some time I would not be able to connect to them and the raspberry pi would freeze if I wanted to list the contents of the mounts. And it works! No more disconnects! I looks like sshfs does not read the ssh config file for some reason and the keep alive signals were never sent. This sounds like a job for autofs. It's rather adept at handling network mounts of various kinds nfs, samba, sshfs, you name it and noticing when those things need re-mounting. It can also takes care of unmounting them after periods of disuse and mounting them when a file system request is made. If there are still people encountering this problem, I still could not fix it. I did find a working workaround. The following ruby script did the trick. It creates a folder called "keepalive" over and over. Just keep running this until infinity. I do not know why this works. But it seems to solve my problem where I am inactive for a minute and everything freezes. It just tries to create a folder at the mounting point and that seems to keep it from disconnecting and freezing everything somehow. Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. What is a better way to deal with server disconnects of sshfs mounts? Ask Question.

Oh no! Some styles failed to load. šŸ˜µ


By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I use sshfs to connect to a remote server. When my computer goes to sleep or internet drops, sshfs tries to reconnect when the connection comes back, but does not ask me for a password. Because of this, the reconnect fails, and after several attempts my IP address is blocked indefinitely from connecting to the server until I convince them to unblock me. Overall this is completely untenable. How can I prevent sshfs from reconnecting? How are we doing? Please help us improve Stack Overflow. Take our short survey. Learn more. Prevent sshfs reconnecting Ask Question. Asked 4 days ago. Active 4 days ago. Viewed 8 times. Ben Southworth Ben Southworth 1 1 silver badge 8 8 bronze badges. Active Oldest Votes. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Q2 Community Roadmap. The Unfriendly Robot: Automatically flagging unwelcoming comments. Featured on Meta. Community and Moderator guidelines for escalating issues via new responseā€¦. Feedback on Q2 Community Roadmap. Triage needs to be fixed urgently, and users need to be notified uponā€¦. Technical site integration observational experiment live on Stack Overflow. Dark Mode Beta - help us root out low-contrast and un-converted bits. Related 2. Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled.

Subscribe to RSS


By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up. Very occasionally the connection will be broken if there's a power or Internet outtage, and in these cases I would have to recognise this has happened and manually reconnect using the same command. Is there a way I can get my Ubuntu Server to automatically attempt to reconnect, say every 30 seconds, if the connection goes down? I am duplicating it here. The result is that if the server is unavailable for 1 minute, sshfs will reconnect to the server. Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. Asked 4 years, 3 months ago. Active 4 years, 3 months ago. Viewed 19k times. Ozzah Ozzah 3 3 gold badges 7 7 silver badges 16 16 bronze badges. Active Oldest Votes. Seth Difley Seth Difley 6 6 silver badges 9 9 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Cryptocurrency-Based Life Forms. Q2 Community Roadmap. Featured on Meta. Community and Moderator guidelines for escalating issues via new responseā€¦. Feedback on Q2 Community Roadmap. Linked 7. Related Hot Network Questions. Question feed. Ask Ubuntu works best with JavaScript enabled.

Subscribe to RSS

Welcome to LinuxQuestions. You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions. If you need to reset your password, click here. Having a problem logging in? Please visit this page to clear all LQ-related cookies. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. My current attempts to make this function cleanly are failing. This is what I've tried: 1. Using Wicd's 'scripts' functionality to unmount the drives before disconnection, but I don't know if Wicd knows that Sleep is happening 2. KDE's PowerDevil allows for actions before sleep; I put a script there to unmount the drives before sleep 3. I have Wicd via 'scripts' try to reconnect the drives after a 5sec delay upon reconnecting to the network, but if the mount points aren't cleanly unmounted this usually causes the hang 4. Sometimes things just seem to hang for no reason. Sometimes everything works just fine. My mount scripts call for SSHFS to use: -s disable multi-threaded operation -o reconnect My unmount fusermount scripts use: -u unmount -z lazy unmount and seem to generally work well when I am testing the scripts. It's the Sleep action that seems to be causing most of the issues, as I have a hard time recreating the issue when I am just testing by running the various commands. Can anyone help me to figure out the best way to make this function? Earlier today I thought maybe the unmount script could be given UID perms to allow the user account to run root permissions to better unmount these network connections before sleep, but I am not sure yet if that is a good solution or not. Suggestions anyone? Find More Posts by lefty. Well it's possible to run sshfs over autofs so that would disconnect the mount when it was idle. I'm not sure if that would be wholly suitable if she likes to slam the lid done immediately after using those files, but aside from the time taken to re-establish the sshfs connection on first use of the mount point, it's a really nice model that makes this sort of thing a non-issue. SSH keys passwordless are working fine for normal sshfs and ssh operations. Last edited by lefty. Reason: edited for clarity. I'm no expert, but maybe try afuse, an automounter for fuse file systems? This is my first post on linuxquestions. Tags fusekdenetworksleepsshfs Thread Tools. BB code is On. Smilies are On.

VSCode SSH: Remote Development on Visual Studio Code using SSH FS



Comments on “Sshfs reconnect

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>