Questions tagged [scp]

Secure Copy or SCP is a means of securely transferring computer files between a local host and a remote host or between two remote hosts. It is based on the Secure Shell (SSH) protocol.

The SCP protocol is a network protocol, based on the BSD RCP protocol, which supports file transfers between hosts on a network. SCP uses Secure Shell (SSH) for data transfer and utilizes the same mechanisms for authentication, thereby ensuring the authenticity and confidentiality of the data in transit. A client can send (upload) files to a server, optionally including their basic attributes (permissions, timestamps). Clients can also request files or directories from a server (download). SCP runs over TCP port 22 by default. Like RCP, there is no RFC that defines the specifics of the protocol.

Source: wikipedia

As per documentation of the most widespread implementation OpenSSH, the protocol is considered "outdated, inflexible and not readily fixed". Using more modern protocols like sftp and rsync for file transfer is recommended.

432 questions
0
votes
0 answers

SCP to an EC2 instance is failing but SSH works

I'm trying to scp a jar file to an EC2 instance that hosts a service I'm working on. I'm able to ssh into that EC2 instance without issue. When I attempt to scp the file with the following command: scp -vvv foo.jar instance-id:/tmp/ I'm prompted…
mbakhiet
  • 1
  • 1
0
votes
0 answers

Ubuntu 20.04 / 22.04 - Remote ssh or rsync killing all process from user

I got a weird strange odd behavior (there's not enough adjectives for that) on Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. This is a IBM Db2 test server. The server runs a Db2 service under db2inst1 user id (UID 1002). The server name is…
adamitj
  • 113
  • 4
0
votes
1 answer

Can I seperate SCP and SSH login, using different ports and different users?

I want to separate SCP to be on a different TCP port than the regular port 22. Using this port, a user should only be able to run SCP commands but not to do a regular SSH login. That user would not have access to regular SSH login on port 22, and…
Yair
  • 1
0
votes
1 answer

SCP between 2 remote servers with local key

I'm currently using KeePass and ssh-agent for passwordless ssh/scp access to servers. I also use the ~/.ssh/config file to make life a bit easier. I find it works quite nicely for most of my use cases. My local system uses "openssh for windows 8.1"…
0
votes
1 answer

scp between two redhat server stalls at 98% for long time

I have 2 RedHat servers (say rhel-01 and rhel-02) with 40G ports connected via 40G switch. When I'm trying to copy any large file (larger than 1G) from rhel-01 to rhel-02 it stalls at exactly 98% for one to one and half minutes and then completes…
0
votes
2 answers

scp with -C flag does not perform compression

The scp man page shows that the -C flag can be used for compressing a file on the fly while performing a remote copy - $ man scp | grep "\-C" -C Compression enable. Passes the -C flag to ssh(1) to enable compression. However, when I…
Anish Sana
  • 123
  • 6
0
votes
2 answers

Copy a file via SCP to target but move directory structure upwards?

I need a script for my Java project (on Ubuntu) to deploy the .jar file to a remote windows server using scp. This is what my script looks like: scp build/libs/app.jar foo@192.68.40.41:test/ The app.jar is being copied to the Windows path…
xetra11
  • 331
  • 1
  • 2
  • 10
0
votes
1 answer

ssh-copy-id -- send pubkey to other location then ~/.ssh/auhtorized_keys?

I want to acces a remote server via ssh which has set the location for authorized keys set as /path/to/ssh/authorized_keys.%u. Now I am wondering how I can motivate ssh-copy-id to create an authorized_keys file at that location following that naming…
vrms
  • 287
  • 1
  • 7
  • 17
0
votes
1 answer

scp from Windows Server to Unix server works but not the other way around

I installed OpenSSH on my Windows Server machine to use SSH. To test this out, I ran this command from my windows server. scp test.txt user@unixserver.company.com:/path Which worked, I can see the file on unix via putty. However, if I run this…
J.Do
  • 101
0
votes
1 answer

Issue with Apache permissions with scp'ed document root content

I have a server running apache which has as document root /var/www/html/. Apache runs as apache:apache. This server is filled with content which is scp'ed programmatically from another server which uses a different user to login via ssh than apache,…
JoeSlav
  • 99
  • 2
  • 12
0
votes
1 answer

Expecting a password in the middle of script in RHEL

I want to copy files from another server it's expecting a password to copy... Where as sshpass is working in Ubuntu, but in RHEL is there a way to pass the password in the script.
0
votes
0 answers

Can I use SCP while having multiple AuthenticationMethods, like publickey,password?

My task is to create a bash script that will copy files from server2 in my server1. The issue is that I can't connect from one server to another. I have whitelisted server1 IP on my server2 22 port. When I try to connect, I receive: Permission…
Daniel
  • 1
  • 1
0
votes
2 answers

How can I ask a remote server that was never connected with my local machine to connect with me by SSH?

I use an old server, that has not been updated and that cannot be updated. The OS is FreeBSD, there is no Python, obviously Ansible, and no sshpass. I access this old server from my personal computer using Ansible and ssh. Both of them (my computer…
0
votes
0 answers

Send command to another machine in a secure credential way

I have a question to ask you: I am creating a script to use with certbot for the renewal of certificates via DNS, everything works correctly on the same machine where BIND is also running (this machine is experimental). Since the automation tests…
MrTaik
  • 27
  • 8
0
votes
0 answers

scp.SCPException: ser **** (100) may not copy files

I'm not sure why I see this error message at times and other times the scp succeeds without any issues. How do I fix it? Traceback (most recent call last): File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File…