LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-04-2015, 02:06 AM   #1
ramuind
LQ Newbie
 
Registered: Jan 2015
Posts: 1

Rep: Reputation: Disabled
ssh script to transmit files to remote server


Hi , I am using below script to transmit file to different network ssh connect is successful but unable push files.

Command-line parameter: ssh uesrname@101.10.112.23 /.ssh/ixa_test.pub cd /ixa mput *.*


Thanks
 
Old 01-04-2015, 02:21 AM   #2
yo8rxp
Member
 
Registered: Jul 2009
Location: Romania
Distribution: Ubuntu 10.04 Gnome 2
Posts: 102

Rep: Reputation: 31
usage is scp source_file user@ip_addr:/path_where_to_put_files
Keep in mind that source and destination are allways in this order ,
if willing to copy from ssh to local then reverse values
scp user@IP:/path_to_source local_destination

if ssh port differs from 22 then use scp -P port_number and the above
Eg.

Quote:
scp test gabriel@1.2.3.4:/home/gabriel/Desktop/

or specify port number
Quote:
scp -P 22 test gabriel@1.2.3.4:/home/gabriel/Desktop/
where test is local file to push , and Desktop is the final path
If willing to save as a different name use
Quote:
scp test gabriel@1.2.3.4:/home/gabriel/Desktop/test_file_renamed

To copy from ssh server to local then
Quote:
scp gabriel@1.2.3.4:/home/alpha_centauri/source_file /home/obi_wan_kenoby/
My ssh uses RSA so no user/passwd plain text is broadcast , make sure you do the same by using private/public keys instead of user/passwd


If willing to execute command along ssh connections then use
ssh user@IP 'command1;command2;command3' or multiple commands separated between

eg.
Quote:
ssh gabriel@1.2.3.4 'cd /home/user/ ; ls'

Last edited by yo8rxp; 01-04-2015 at 02:41 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] my shell Script stops after doing ssh to remote server Shasank Linux - Newbie 14 05-11-2012 10:17 AM
copying files from remote server through ssh dave247 Debian 12 11-21-2008 09:56 AM
I am unable to exit my script that uses ssh to login to a remote server jtbinuya Linux - Newbie 2 06-12-2008 10:17 PM
FTP files to remote server with a shell script Pezzoni Linux - Software 2 06-27-2007 07:01 AM
copy files using SSH from a server to another..both remote Santosh_d Linux - Networking 6 03-10-2004 11:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:07 AM.

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