You are not logged in.

#1 2008-11-10 19:26:13

BeholdMyGlory
Member
Registered: 2008-08-30
Posts: 93

Upload file to SSH server

I've got some homework from computer science; one being the simple task of uploading a file to an Ubuntu ssh server.
The problem is, I just can't figure out how to do it. It's described very well how to do it from Windows, using a program called pscp, but it just happens to be so that I don't run Windows.

I searched a bit on the web, came up with this link: http://news.metaparadigma.de/?p=226 , but I just don't know how to use the commands.

Just so you know, I've never used ssh before at all tongue

Offline

#2 2008-11-10 19:32:51

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Upload file to SSH server

scp file user:password@host:/path

password is optional, you'll get asked for it anyway; scp is part of the openssh package

Offline

#3 2008-11-10 20:05:43

BeholdMyGlory
Member
Registered: 2008-08-30
Posts: 93

Re: Upload file to SSH server

lucke wrote:
scp file user:password@host:/path

password is optional, you'll get asked for it anyway; scp is part of the openssh package

Wow, thanks!

Offline

#4 2008-11-10 20:07:44

Hrod beraht
Member
Registered: 2008-09-30
Posts: 186

Re: Upload file to SSH server

When it's not for a homework assignment, you can also mount the server via sshfs and then use your file manager to drag and drop.

Bob

Offline

#5 2008-11-11 04:16:26

arew264
Member
From: Friendswood, Texas, US
Registered: 2006-07-01
Posts: 394
Website

Re: Upload file to SSH server

Although it's somewhat crappy, there's also sftp, which works just like commandline ftp.

Offline

#6 2008-11-16 21:53:01

aport
Member
From: San Diego
Registered: 2008-02-20
Posts: 99

Re: Upload file to SSH server

You should use SSH all the time!

Offline

#7 2008-11-16 22:02:41

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Upload file to SSH server

arew264 wrote:

Although it's somewhat crappy, there's also sftp, which works just like commandline ftp.

Actually scp is sftp.

Offline

#8 2008-11-16 22:27:35

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Upload file to SSH server

Daenyth wrote:

Actually scp is sftp.

They're not:

[stijn@hermes ~]$ file /usr/bin/sftp 
/usr/bin/sftp: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped
[stijn@hermes ~]$ file /usr/bin/scp 
/usr/bin/scp: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped

They're just both part of the SSH suite, and provide similar functionality. But they occupy different inodes, so they're clearly different binaries,

[stijn@hermes ~]$ ls -i /usr/bin/scp 
146906 /usr/bin/scp
[stijn@hermes ~]$ ls -i /usr/bin/sftp 
146903 /usr/bin/sftp

Last edited by B (2008-11-16 22:31:27)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#9 2008-11-17 02:11:05

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Upload file to SSH server

Sorry if I wasn't clear; scp uses the sftp protocol.

Offline

#10 2008-11-17 09:18:12

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,000
Website

Re: Upload file to SSH server

lucke wrote:
scp file user:password@host:/path

password is optional, you'll get asked for it anyway; scp is part of the openssh package

Uhm.. Do not put your password in plaintext in your commandline... use user@host.  It will ask.  Unless you want your password visible on the commandline, in your shell history , in ps, in /proc, etc.


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#11 2008-11-17 15:43:18

Redroar
Member
Registered: 2008-03-17
Posts: 200

Re: Upload file to SSH server

Better yet, chuck the password entirely and use pub/privatekey authentication with a passphrase.


Stop looking at my signature. It betrays your nature.

Offline

Board footer

Powered by FluxBB