[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Transferring files over SSH in the console



On Sunday 21 March 2010 23:14:32 Andrew Reid wrote:
> On Sunday 21 March 2010 18:52:36 Dotan Cohen wrote:
> > I am managing a small embedded device that I SSH into over the LAN. To
> > run commands, I use KDE Konsole, and to transfer files I use Konqueror
> > and SFTP. I understand that SFTP also runs over SSH, so is there a way
> > to send files in Konsole as well? I am familiar with the FTP commands
> > such as cd, lcd, put, and get. Are there equivalent commands for SSH
> > terminal connections?
>
>   As others have commented, you can use scp or sftp.
>
>   However, I can imagine that embedded might not have the
> sftp service or the scp executable.
>
>   If that's your case, you can always do:
>
> # cat file | ssh remote 'cat > destinaton'

  Pardon my replying to myself, but I've now seen a bunch of the 
rest of the thread, and it seems to me that, if the set of commands
you want to do is repeatable, then maybe what you want is to do 
most of the remote-system operations through SSH commands this way?

  Someone else may have already suggested this, but something
like:

# cat file.tgz | ssh remote 'cat > dest.tgz' (or scp, if available)
# ssh remote 'tar -xf dest.tgz'
# ssh remote 'sh dest/installer' (or whatever)
# ssh remote 'cat dest/install-log' > remote-install-log  (or whatever)

  This way, you still only have the one shell, and/but you
pay the price in having to prefix all the remote operations
with "ssh remote".  However, you could script this on the 
local system (which is, I think, why you want a single 
session, right, so you can script it?), and then the extra
typing doesn't really cost you much.

			-- A.
-- 
Andrew Reid / reidac@bellatlantic.net


Reply to: