FAQ Database Discussion Community


TCSH scripts and the scp command

scp,csh,tcsh
I'm scratching my head at the following odd behaviour seen under Ubuntu Linaro (on a Parallella). This scp command works fine by itself: $ scp [email protected]:~/myMPI/filename [email protected]:~/myMPI/ But once I wrap it into a script: #!/bin/tcsh -f scp [email protected]:~/myMPI/$1 [email protected]:~/myMPI/ and issue it, I get this: $ thescript filename user:...

Upload file to server and delete original using NET::SCP gem in Ruby

ruby,scp
I'm using the net/scp gem to upload a file from my machine to a remote Linux server. require 'net/ssh' require 'net/scp' Net::SCP.upload!(10.125.0.0, user, local_path, remote_dir, :ssh => { :password => psw, :key_data => keys}) This works perfectly, however I'd like to be able to 'move' the file instead of effectively...

Get first few kilobytes of remote file through fabric

python,fabric,scp
How do I get the first few thousand bytes of a remote file in Python? Using something like fabric I could call get from fabric.api import get get('remote-path.csv', 'local-head.csv') Unfortunately this would copy the entire file. I only want to inspect the first few hundred lines. Is there a cheap,...

Remote path completion with scp on OSX

osx,bash,ssh,osx-yosemite,scp
On Linux, you can do $ scp some-file.txt [email protected]:/some/pa<tab> and it would autocomplete the remote path, if you have key based authentication up and running for that host. However, on OSX it doesn't seem to work, using iTerm2. Any hints? ...

How to copy using scp on shell script to folders space named?

shell,folder,scp
Hey guys I am working on this app that connects to Raspberry Pi through SSH. I use NSTask and NSPipe and shell scripts to execute the shell commands through the Mac app GUI. The problem is that when I want to copy using "scp" command I get "No such file...

Python scp copy images from image_urls to server

python,python-imaging-library,urllib,scp
I have written one function which recieves a url and copy it to all server. Server remote path is stored in db. def copy_image_to_server(image_url): server_list = ServerData.objects.values_list('remote_path', flat=True).filter(active=1) file = cStringIO.StringIO(urllib.urlopen(image_url).read()) image_file = Image.open(file) image_file.seek(0) for remote_path in server_list: os.system("scp -i ~/.ssh/haptik %s %s " % (image_file, remote_path)) I am...

SCP first line of a file to another system

linux,scp
I think it should be possible to use a combination of the scp command and the head command to copy only the first line of a file to a remote system, but haven't been able to come up with the right command to make it happen. Given an scp command...

net::scp copy/overwriting folder

ruby,ssh,scp
Say you copy folder f_1 from your local machine to target machine m_1 into the /tmp directory as mf_1. console: [[email protected]_1 tmp] ls -a | grep mf_1 # => doesn't exist irb: options = {recursive: true} Net::SCP.upload!(host, user, '~/f_1', '/tmp/mf_1', options) console: [[email protected]_1 tmp] ls -a | grep mf_1 #...

Copying files from server to local computer using ssh [closed]

ssh,scp
I am having trouble copying files from a remote server using ssh. Using putty I log in to the server using ssh. Once I find the file I would like to copy over to my computer, I use the command: scp [email protected]:/dir/of/file.txt \local\dir\ It looks like it is successful, but...

How do I add my own public key to Vagrant VM?

ssh,vagrant,virtual-machine,scp,public-key
I got a problem with adding an ssh key to a Vagrant VM. Basically the setup that I have here works fine. The VMs are created, I can access them via vagrant ssh, the user "vagrant" exists and there's an ssh key for this user in the authorized_keys file. What...

SCP not working for OpenShift

node.js,openshift,scp
I am connected to OpenShift via rhc ssh <myApp>. <myApp> in this case is fela. [fela-basickarl.rhcloud.com 553a...]\> scp nodejs.log [email protected]:~/app-root/logs/ The authenticity of host 'fela-basickarl.rhcloud.com (10.167....)' can't be established. RSA key fingerprint is cf:ee:...:88:a7. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to...

Server gives me a permission error when trying to scp, but not when ssh

bash,ssh,terminal,scp
Is there server configuration you need to set when you want to scp to a server? If i ssh into the machine, i use: ssh -i file.pem [email protected] but when i try the scp command, it will give me a permissions error. scp path/to/file.pdf -i file.pem [email protected]:/home/user/. What am i...

How to transfer a file between two remote servers using scp from a third, local machine?

unix,ssh,scp
I'm trying to copy a file from one remote server to another remote server from my local machine. Here's what I'm trying to do localA $ scp [email protected]:/path/to/file [email protected]:/path The problem is that I need to pass two passwords for both userB and userC on the remote machines. According to...

copy /move the Data from the Linux Command line to local windows

linux,scp,winscp,pscp
Installed CYGWIN in my windows, I can able to access both windows & remote linux machines with the credentials. But i can't able to configure how the data will be moved from Linux to windows, can anyone please suggest me on this. Thanks Srinivas...

pulling file and zip while pulling in UNIX

shell,scp,mkfifo
I am generating files from netezza server using nzsql. Now the next part of the requirement is to zip and move the file into a different box (a second unix box). I can achieve this sitting in the 1st box (sitting in the first box I am first doing gzip...

Copy file to server with specific port using scp in Linux [closed]

linux,centos,port,scp
If I want to copy file from server to my local OS I use this: scp -P 60385 [email protected]:/myserver/somefile.txt /mylocaladdress/. But how do I do the opposite? I tried this: scp /mylocaladdress/somefile.txt [email protected]:/myserver/. -P 60835 And this: scp /mylocaladdress/somefile.txt -P 60835 [email protected]:/myserver/. But I'm getting this error ssh: connect to...

scp + Avoid copy if the same file name located on remote machine?

linux,bash,scp
Is there any option to tell scp command - not copy file from current machine in case file exists on remote machine For example On my machine I have the file - /etc/secret-pw.txt On Remote machine I have also the file - /etc/secret-pw.txt So scp /etc/secret-pw.txt $remote_machine:/etc Will destroy the...

Run SCP From Command Line With Password

python,command-line,centos,fabric,scp
I need way to run SCP from the command line with a password. Specifically, it's because I need to use the Python library Fabric to have one remote machine SCP to another remote machine, without the file passing through the local machine (it's a large file, and the two remote...

scp Authenticates but only gives the Welcome message

bash,ssh,scp
I would like to use passwordless scp scp -i ~/.ssh/id_rsa -P 2022 ~/report.pdf [email protected]:~/ but I only get Welcome user1 to p6. Wed, 28 Jan 2015 - 14:46 PM EST I have added the necessary keys and that shows proper authentication. When I do it in verbose mode I get...

if all else fails tcl script fails

tcl,expect,scp
I am trying to make a script to transfer file to another device. Since I cannot account for every error that may occur, I am trying to make an if-all-else fails situation: spawn scp filename [email protected]:filename expect "word:" send "password" expect { "100" { puts "success" } "\*" { puts...

How to execute multiple commands on machineB from machineA efficiently?

linux,bash,shell,ssh,scp
I have a tar (abc.tar.gz) file in my machineA which I need to copy and untar it in my machineB. In my machineB, I have an application running which is part of that tar file so I need to write shell script which will do these below things on machineB...

make an scp as apache in symfony2 script

apache,symfony2,scp
I have a question about scp and apache user between local and destination hosts. In my computer, i have created a folder .ssh in /var/www/ and i have generated a rsa key for www-data user. Next, i have copied id_rsa.pub content to authorized_key file on destination server. When i make...

Equivalent settings between WinSCP and FileZilla on Tunnel [closed]

ftp,sftp,scp,filezilla,winscp
I am running Ubuntu 14.04LTS and have FileZilla 3.7.3 installed, I also have a VM running WIN7 with WinSCP 5.5.1. Under WIN7 when using WinSCP, in the editing dialog under the advanced tab there is a category “Connection” with two options, Proxy and Tunnel . The server I need to...

(SOLVED) Not working scp command: Connection closed by remote host (Mac OS X)

osx,unix,terminal,scp
I'm working on a remote server through Mac terminal, since i updated it to OSX 10.10 (from 10.5) i started receiving this message every time i try to scp from server to my computer: ssh_exchange_identification: Connection closed by remote host lost connection If i perform scp backwards (copying from mac...

Bash error: “b.sh: line 52: syntax error: unexpected end of file logout”

osx,bash,ssh,scp,eof
So, I wanted this to download a file from my computer, transfer it to my iPhone, install the file there, and respring my phone. For some reason the error you saw in the title pops up. Would be nice if someone could help, thanks. #!/bin/bash clear cd downloads if [...

Executing Abaqus Model in Taverna

ssh,scp,beanshell,abaqus,taverna
I'm pretty new to both Taverna and Abaqus but I am trying to run an Abaqus model using a "Tool" in Taverna remotely on a HPC. This works fine if I already have my model file and inputs on the HPC but I need a way of uploading the files...