Copy a file with SCP on Ubuntu 14 with PEM key on both servers

I have 2 servers on Amazon AWS. I need to pass a file from A to B. Both servers have pem keys (different). I put the pem file of B on A (Is that correct?) Then tried to do from A: scp -i /tmp/B.pem backup.sql.gz ubuntu@ec2-XX-XX-XXX-XX.eu-central-1.compute.amazonaws.com:bckup.sql.gz I get an error: Permission denied (publickey). lost connection … Read more

Copy range of files on Linux/Unix

Background I have already thoroughly read through this question: Copy a range of fiels and tried most of the answers. I exported data into a single .json then split the .json file into smaller serialized files with 50k lines in each. $ls smaller_aaaa smaller_aaak smaller_aaau smaller_aabe smaller_aabo smaller_aaby smaller_aaci smaller_aacs smaller_aadc smaller_aadm smaller_aaab smaller_aaal smaller_aaav … Read more

copy file: Not a directory

I have a NAS mount, and I can copy file to this, but I can’t copy files similar to this cp /home2/user/WRF/WRFV3/run/*_2 . -v `/home2/user/WRF/WRFV3/run/wrfout_d04_2007-11-21_00:00:00_2′ -> `./wrfout_d04_2007-11-21_00:00:00_2′ cp: cannot create regular file `./wrfout_d04_2007-11-21_00:00:00_2′: Not a directory I get this error. EDIT when I try make a file with : in the name, I get a … Read more

Copy-paste heredocument into Bash converts tabs into dots

I use Windows 10 home (build 16299.248) and I’m SSHing into a remote Ubuntu 16.04 machine with various SSH clients (like Putty/MobaXterm). I copy-paste the following code from my personal GitHub account into an SSH session: cat <<-EOF >> “$HOME”/.bashrc export s_a=”/etc/nginx/sites-available” export s_e=”/etc/nginx/sites-enabled” export drt=”/var/www/html” source “$HOME”/”$repo”/software_internal.sh EOF I copy it directly from my … Read more

How to Copy files from one Ubuntu server to another? (MYSQL Database for website migration) [closed]

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 Server Fault. Closed 8 years ago. Improve this question I’m very new to Ubuntu and my first task is to copy one website with a MySQL database to another server. Both servers … Read more