scp

scp files from amazon linux machine to virtual box [closed]

主宰稳场 提交于 2019-12-11 13:34:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am trying copy a directory from my amazon Linux machine to my virtual-box. I write the following command from my amazon Linux machine: scp /home/user/test xyz@xyz-VirtuaBox:/home/user but I get the error message: Could not resolve hostname xyz-virtualbox: Name or service not found. I am not sure what's going

Golang SSH-Server: How to handle file transfer with scp?

喜欢而已 提交于 2019-12-11 10:14:30
问题 I have written a small SSH-Server in golang with the crypto/ssh package. It supports returning an interactive shell and immediate command execution. Here is a minimal example of the server: package main import ( "fmt" "io/ioutil" "log" "net" "os/exec" "golang.org/x/crypto/ssh" ) func main() { c := &ssh.ServerConfig{ PasswordCallback: func(c ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error) { if c.User() == "foo" && string(pass) == "bar" { return nil, nil } return nil, fmt.Errorf(

I would like to simplify SSH Tunneling to do a MySQL Dump and SCP the file to local machine

只谈情不闲聊 提交于 2019-12-11 08:59:04
问题 Server setup (fake IPs) utility - 1.1.1.1 - SSH access on public IP database2 - 1.1.1.2 - SSH access on private IP from utility On a semi-regular basis I need to do a mysqldump on database2 and pull that down to my local machine so I can debug our app with real data. My current process is as follows: ssh into utility ssh into database2 execute mysqldump command exit from database2 scp dump file down to utility exit utility scp dump file down to local machine Needless to say this is not

sftp/scp files with bash

社会主义新天地 提交于 2019-12-11 05:55:19
问题 I have the need to upload a set of files to an sftp account. My first thought was to use php's ssh2_connect() function and I was able to get this working locally no problem. However, once I moved to the dev environment I quickly realized that this wasn't a good solution because there are too many dependencies that wont exist and installing them would require too many approvals from too many people. So, my next thought was to use bash, and this is where I need help. I will be running this bash

JavaScript File Transfer SSH

点点圈 提交于 2019-12-11 03:04:05
问题 I'm currently working on a browser based project where I'm using JavaScript, HTML and CSS for the first time, having had no past experience with these languages. Basically the project involves the following: (1) allowing the user to upload a .csv file via the following code: <input id="files" type="file" accept=".csv" /> (2) Reading the file, (3) converting to a YAML file (.yml) and (4) uploading it to a remote server via SSH/SCP/SFTP. I've done (1) and (2) but what I'm having real trouble

ssh2_scp_send() using php corrupts pdf

强颜欢笑 提交于 2019-12-11 01:37:59
问题 I am having a problem when I am sending a pdf file to my server. my script works when I try to send .csv file but the problem occurs when I try to send a pdf file <?php $user= "username"; $pass= "password"; $src= "/home/desktop/myfile.pdf"; $trg= "/server/path/myfile.pdf"; $con = ssh2_connect('myserver.com', 22); ssh2_auth_password($con, $user, $pass); ssh2_scp_send($con, $src, $trg); ?> when I send pdf. it creates a pdf file in target location but its corrupted. 回答1: Try SFTP. Examples

Why does this bash script work at console but fails when run as a cron job?

半世苍凉 提交于 2019-12-10 18:14:16
问题 I have the following bash script, which runs without problems at the CLI, but fails when run as a cron job. #!/bin/bash cd /home/oompah/scripts/tests/ scp -P 12345 file1 oompah@someserver.com:~/uploads if scp -P 12345 oompah@someserver.com:/path/to/file2.dat local.dat >&/dev/null ; then echo "INFO: transfer OK" ; else echo "ERROR: transfer failed" ; fi The error message I get (redirected to a log file) when I run it as a cron job is: ERROR: transfer failed The error message I get in my mail

scp files in a certain order using ls

独自空忆成欢 提交于 2019-12-10 17:31:03
问题 Whenever I try to SCP files (in bash), they end up in a seemingly random(?) order. I've found a simple but not-very-elegant way of keeping a desired order, described below. Is there a clever way of doing it? Edit: deleted my early solution from here, cleaned, adapted using other suggestions, and added as an answer below. 回答1: To send files from a local machine (e.g. your laptop) to a remote (e.g. your calculation server), you can use Merlin2011's clever solution: Go into the folder in your

Docker RUN fails with “returned a non-zero code: 6”

允我心安 提交于 2019-12-10 13:47:43
问题 I have the following in my docker file: RUN sudo apt-get install sshpass -y RUN sshpass -p userPassword scp -r user@server:~/data/* ./ But when I try and build my image it fails with: Exception caught: The command '/bin/sh -c sshpass -p userPassword scp -r user@server:~/data/* ./' returned a non-zero code: 6 -> [Help 1] However, if I remove these lines, build the image, ssh onto the container and manually run the command from bash it works perfectly. Can anyone tell me how to get around this?

Issues with using Jump Host

荒凉一梦 提交于 2019-12-10 12:23:55
问题 How do I transfer a file from my local machine to a remote host to which I need to get through a jump host? These are the steps I follow to connect to the remote host 1. ssh myname@jump-host 2. enter password 3. sudo su - another-random-name 4. ssh name@remote-host Now I want to transfer a file from my local machine to the remote-host. How would I achieve this? I have already tried scp -oProxyCommand but I don't quite know where I should include step 3 as part of this command? 回答1: Use port