LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-06-2006, 03:47 PM   #1
Maverick1182
Member
 
Registered: Aug 2004
Location: London
Distribution: Gentoo
Posts: 277

Rep: Reputation: 30
Copying files to local computer whilst in ssh tunnel


Hi there, after the inital excitement of connecting to my college network drive from home via the console I was wondering how I can pull files (or push them onto) my network drive? The "cp" command wont work because there's no way of specifying the local of your home computer as the desitination as it is all done relative to the college network drive. I have tried

ssh target_address cat remotefile > localfile


and it works brilliantly but the only problem is that it assumes you know the exact location of the file before you start. is there anyway I can connect via ssh and then browse round and then pull the files pack to my local machine whilst in the ssh tunnel (and vice versa with push) ?
 
Old 10-06-2006, 03:51 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Look at scp.
 
Old 10-06-2006, 04:30 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
sshfs is convenient if you're be copying a bunch of files from differing locations. You effectively "mount" the remote computer (in it's entirity or just a part of it) to a mountpoint on your local computer. All over a single ssh tunnel that needs nothing special on the remote server.

Mounting goes like this:
Code:
$ sshfs remote_userid@remote_host.domain.com:/ /mnt/local_mountpoint
And unmounting, like this:
Code:
fusermount -u /mnt/local_mountpoint
After mounting, the remote system appears just like a local resource, so you use standard commands like "cp" to do your copying. You are of course limited by file permissions enforced by the remote. You can't copy a file if the remote denies you reading it in the first place.

The cool thing about this is,the remote server only has to have a normal ssh server installed. Nothing else. Locally, you have to install sshfs though.
 
Old 10-06-2006, 06:21 PM   #4
Maverick1182
Member
 
Registered: Aug 2004
Location: London
Distribution: Gentoo
Posts: 277

Original Poster
Rep: Reputation: 30
The problem with scp seems to be the same as with ssh (from what i've read) it still needs inputs as you execute the command to create the tunnel. The second option of a mount is more or less what I think i'm after. Sorry if I explained it badly. Is there a maximum number of connections i can have using ssh to the same server? eg. can i mount the home directory and still move around in the directory using a ssh command and run applications? or is it one tunnel per server?
 
Old 10-07-2006, 01:29 PM   #5
Maverick1182
Member
 
Registered: Aug 2004
Location: London
Distribution: Gentoo
Posts: 277

Original Poster
Rep: Reputation: 30
haertig , i've got exactly what i wanted which was to get sshfs running. it connects fine with my remote computer at university. I've even made a lil script to connect it and open konqueror to the mount file. THe problem is that konqueror doesnt seem to be able to locate it. I can see it as root and can play around with the files but as a normal user, I cant seem to see it in my session. I've tried to chmod 777 the /mnt/IC folder which sshfs mounts to. The permissions seem to have changed as seen below:
heaven mark # ls -l /mnt
total 60
drwxrwxrwx 1 58382 6957 4096 Oct 6 20:53 IC
drwx------ 2 root root 4096 Feb 14 2006 cdrom
drwxr-xr-x 2 root root 4096 Jul 27 08:53 cdrw
drwxr-xr-x 2 root root 4096 Jul 27 08:53 dvd
drwxrwxrwx 23 root root 4096 Oct 7 16:26 fatty
drwx------ 2 root root 4096 Feb 14 2006 floppy
drwxr-xr-x 2 root root 4096 Jul 26 22:24 opt
drwxr-xr-x 2 root root 4096 Aug 12 18:39 tempstuff
drwxr-xr-x 2 root root 4096 Jul 26 22:24 usr
drwxr-xr-x 2 root root 4096 Jul 26 22:24 var
dr-x------ 1 root root 8192 Oct 7 15:21 winc
dr-xr-xr-x 1 root root 12288 Sep 27 21:46 wind


Any ideas? I'm so close! lol


EDIT: i found a fast way to use ssh in konqueror , simply type use fish

so its "fish://username@computer_name-or-host" in the address bar, it will ask for a password and then log you in, hope this helps people. like me. heres a good link

http://www.linux.org/lessons/short/fish/x30.html

Last edited by Maverick1182; 10-13-2006 at 04:49 PM.
 
  


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
Error whilst copying from Dvd Drive: final60 Linux - Hardware 3 04-23-2006 01:44 AM
copying files from another server and printing it in local notepads Prasun1 Linux - General 1 09-20-2005 03:40 AM
Tunnel all internet traffic through a ssh connected remote computer Bateman Linux - Networking 12 12-10-2004 05:53 AM
copying files from another computer(win) lin00b Linux - Newbie 5 07-27-2004 03:53 AM
Opening remote files (during ssh session) with applications on local computer? The_Fed Linux - Newbie 3 05-10-2004 04:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:16 PM.

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