Linked Questions
17 questions linked to/from Copy file using scp fails (debug1: Exit status -1)
15
votes
6
answers
103k
views
scp "lost connection" but ssh works fine
A server I can ssh into fine has begun refusing to scp.
$ scp ~/tmp/foo [email protected]:~/tmp/
lost connection
With scp -v -v I can see the connection succeeds and the transfer appears to ...
7
votes
4
answers
14k
views
ssh without using the user's default shell
There was a vote to close this as "unclear what you're asking". Apparently being thorough isn't a good thing, so I'll be terse:
When you SSH to a remote host: is it possible to execute a program ...
7
votes
2
answers
9k
views
SSH without sourcing .bashrc
I was experimenting with my .bashrc file while remotely logged in to a server over SSH. I inadvertently left an exit in there that caused all subsequent logins to immediately disconnect. I was ...
3
votes
4
answers
8k
views
How to test scp without sending a file?
I have a setting where only scp connections are allowed to a remote server, with ssh login being disabled (i.e. you can't get a shell into that server), and I am seeking a clean way to test the ...
2
votes
2
answers
10k
views
How can I execute a command on a remote server through scp?
When using ssh to access raspberry pi running balenaos, ssh -t -p 22222 root@device-ip "balena-engine exec -it <container_name> /bin/sh" grants me access to a specific container inside ...
4
votes
3
answers
2k
views
Prevent scp from copying local files?
I just read the Linux scp command issue question and it reminded me that I regularily forget to specify the colon in the host part of a scp command, and thus copying a file locally instead of copying ...
1
vote
1
answer
5k
views
how do I run a sudo command and load the environment variables of current logged on user?
I need to run an ssh sudo command.
command is as follows:
ssh -i keyfile [email protected] 'sh -v /opt/dir/script'
the script contains the following:
sudo -E node some.js
the reason I use the -E ...
0
votes
1
answer
2k
views
scp fails with -T in different scp versions
I'm having a strange behavior with scp and the option -T in Ubuntu 16.
On one PC with scp version 1:7.2p2-4ubuntu2.8 I run the command to scp a file from remote PC to my local PC and the file gets ...
0
votes
1
answer
2k
views
SCP from server to local host failed
I am sure I was SCPing some files TO the server before, but now it does not work in opposite direction.
I'm using:
$ scp -v mysrv:/home/XXX/dir/app.rb app.rb.bak
Authenticated to mysrv ([88.88.111.11]...
0
votes
1
answer
1k
views
How do I use a bat file to continue using `sftp` after running `sftp.exe`?
I would like to use a bat script to do the task of uploading a file.
sftp -i C:\Users\Sage\.ssh\tencent [email protected]
put E:\React\sage-react\dist /home/freedom/local/dist
But when sftp is ...
0
votes
1
answer
702
views
How to transfer files to server with RSA key auth?
I'm in PowerShell and I can ssh into the server via:
ssh -i my_rsa [email protected]
How can I transfer files with this same my_rsa private key? Filezilla doesn't support the key and I've tried to convert ...
0
votes
1
answer
330
views
How to scp java innerclass with '$1' in its name
Files
sample$1.class
sample.class
scp_test.sh
scp_test.sh
#!/bin/bash
TARGET=('sample.class' 'sample$1.class')
for dd in "${TARGET[@]}"
do
FILENAME=`basename ${dd}`
scp ${FILENAME} ...
0
votes
0
answers
588
views
How to use SSH key with SCP only and not SSH, etc…?
I needed to script some SCP operations, so I used ssh-keygen and ssh-copy-id to allow me to run it without entering a password every time.
However, SSH now works without a password, too: I can just ...
1
vote
0
answers
333
views
SCP silently ignored on the remote machine
When I'm trying to copy a file using scp (in whatever direction), there's no error displayed (although the returned $? code is 1), all I can see is the message that normally the REMOTE machine prints ...
0
votes
1
answer
227
views
Why Do ssh and scp See Different File Systems
My ssh to a host "sees" one file system; my scp sees a different one. How can this be the case, and how can I fix it. e.g.
$ ssh me@otherpc 'ls -l /tmp/media-files.txt'
-rw-r--r-- 1 me me ...