sftp to UNIX host


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sftp to UNIX host
# 1  
Old 12-25-2010
sftp to UNIX host

Hi,
I am writing a shell script that securely connects to an UNIX host and transfer file(abc.txt) from the local machine to the host.

sftp user@host
get abc.txt
bye

The code doesn't work..
It throws error at line 2: get :Unknown get command.

How can I rectify this problem?
# 2  
Old 12-25-2010
I am not sure. The get command works for me. Maybe you have a different version of sftp? Type help in sftp and see the available commands for you.
# 3  
Old 12-25-2010
This showuld do it

Kishore,

When you say "shell script" I assume you are initiating the connection from a unix/linux box.

Code:
scp  /pathto/source  username@destination_ip_or_hostname:/pathtodestination

Also, if you are looking for an automated way of file transfer you may attain it via ssh public/privet key's.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

SFTP file check through a remote host

Hi all, posting my first time, hope not breaking posting rules with it, if yes, let me know. I'm trying to build a script to check a file in an sftp server through a remote server. The intention is to check the file in a sftp host, and if the file is found or not, it should send an email.... (4 Replies)
Discussion started by: MrShinyPants
4 Replies

2. UNIX for Beginners Questions & Answers

Best performance UNIX just for HOST Virtualization?

Hi everybody, Which Unix base OS have best performance for HOST virtualization? I tested SmartOS but it needs another OS to connect remotely! Thanks in advance. (11 Replies)
Discussion started by: mbzadegan
11 Replies

3. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

4. UNIX for Dummies Questions & Answers

UNIX script to use ssh to host

I am doing an old-school command to get an inventory to many host using ssh thru Solaris machine. Please help me find a way thru script to get this automized. This will make me lazy but will surely benefit out of it. thanks in advance. Process I am doing: Host IPs (examples): 10.210.1.2... (1 Reply)
Discussion started by: TripleHar
1 Replies

5. Shell Programming and Scripting

SFTP latest file from Windows server to Unix host

Hi All, I am SFTP ing file from Windows server (Sydney) to Unix host in London (both servers are on different timezones). It appears the upstream (Windows server team) does not do a file housekeeping activity and henceforth there are multiple files i.e. each week the script is scheduled to run... (1 Reply)
Discussion started by: vigdmab
1 Replies

6. Solaris

ILOM to unix host

Hello- On Solaris 10g x86 - I had two IP addresses , one for unix host (connecting through putty) and one for ILOM (connecting through CLI and web). I had to perform some changes in FS sizes etc, did that on unix host and executed command 'init 6' remotely for them to take place. But, the unix host... (30 Replies)
Discussion started by: panchpan
30 Replies

7. UNIX for Dummies Questions & Answers

Searching for HOST NAME in UNIX

Hello, I am new to UNIX OS and I am planning to learn on how to use it since I was granted with the joy of being responsible of SCO UNIX on our network :-) So, can someone please tell me how to search for a particular string on our UNIX box specifying a server name...??? For some reason... (6 Replies)
Discussion started by: George26
6 Replies

8. UNIX for Advanced & Expert Users

Unix / Host explorer

Anyone know where I can get a download of a unix / aix explorer (pref with X-Windows) to run from Windows XP, as I transfer files between the two systems on a frequent basis. (3 Replies)
Discussion started by: gefa
3 Replies

9. Solaris

Unix virtual host detection

Is it possible to reliably detect the virtual host of a Sun Solaris box, within a shell or Perl script? Can a system have multiple virtual host or not host at all ? I was recently made aware of hostname command, but was not sure if this option was the only one available. Any help is much... (3 Replies)
Discussion started by: Meridian
3 Replies

10. Solaris

Unix virtual host detection

I have a need to write scripts that can reliably determine the virtual host of a Sun Solaris system. (1 Reply)
Discussion started by: Meridian
1 Replies
Login or Register to Ask a Question