The -i
flag specifies the private key (.pem file) to use. If you don’t specify that flag (as in your first command) it will use your default ssh key (usually under ~/.ssh/
).
So in your first command, you are actually asking scp
to upload the .pem file itself using your default ssh key. I don’t think that is what you want.
Try instead with:
scp -r -i /Applications/XAMPP/htdocs/keypairfile.pem uploads/* ec2-user@publicdns
Related Posts:
- How to pretty print XML from the command line?
- What are file descriptors, explained in simple terms?
- How to kill a process running on particular port in Linux?
- Display exact matches only with grep
- How to split a delimited string into an array in awk?
- Display exact matches only with grep
- What does ^M character mean in Vim?
- What does it mean to write to stdout in C?
- What do ‘real’, ‘user’ and ‘sys’ mean in the output of time(1)?
- mkdir’s “-p” option
- wait(null) and wait(&status) C language and Status
- Shell script “for” loop syntax
- How to get the current directory in a C program?
- When could or should I use chmod g+s on a file or directory?
- How to Sum a column in AWK?
- Equivalent of *Nix ‘which’ command in PowerShell?
- What is the difference between SIGSTOP and SIGTSTP?
- How to colorize diff on the command line
- How to colorize diff on the command line
- How to read a file into a variable in shell?
- gpg decryption fails with no secret key error
- What is the difference between tar and zip?
- Display current path in terminal only
- What do the dup() and dup2() systems really do?
- What generates the “text file busy” message in Unix?
- Reasoning behind C sockets sockaddr and sockaddr_storage
- How can I send an email through the UNIX mailx command?
- Rename multiple files based on pattern in Unix
- What is the difference between a symbolic link and a hard link?
- binary operator expected error when checking if a file with full pathname exists
- What is special about /dev/tty?
- How do I do ‘mount –bind’ in /etc/fstab?
- How to read backward from the end of file in less or more?
- Getting the last match in a file using grep
- Chmod 777 to a folder and all contents [duplicate]
- scp with port number specified
- What is newline character — ‘\n’
- Why does ENOENT mean “No such file or directory”?
- How do I grep recursively?
- What is the meaning of *nix?
- In the shell, what does ” 2>&1 ” mean?
- How do I copy a folder from remote to local using scp?
- grep –ignore-case –only
- scp or sftp copy multiple files with single command
- What are .a and .so files?
- Copying a local file from Windows to a remote server using scp
- What is difference between Lightsail and EC2?
- How can I check if a directory exists in a Bash shell script?
- Connect: Socket operation on non-socket
- How do I use grep to search the current directory for all files having the a string “hello” yet display only .h and .cc files?
- SSH using python script
- How can I exclude directories from grep -R?
- Using putty to scp from windows to Linux
- Cannot read configuration file due to insufficient permissions
- What is a bus error? Is it different from a segmentation fault?
- Extract file basename without path and extension in bash
- Which characters need to be escaped when using Bash?
- Cannot read configuration file due to insufficient permissions
- What is cp: cannot stat error in Unix, I get this error when trying to copy thing from one folder to another
- cp: missing destination file operand after
- How to download a file from server using SSH?
- Get Unix timestamp with C++
- What is cp: cannot stat error in Unix, I get this error when trying to copy thing from one folder to another
- Difference between Amazon EC2 and AWS Elastic Beanstalk
- Transfer files to/from session I’m logged in with PuTTY
- What does `set -x` do?
- Is there any simple way to benchmark Python script?
- Sorting data based on second column of a file
- How to grant permission to users for a directory using command line in Windows?
- Variable interpolation in the shell
- Using ls to list directories and their total sizes
- Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel
- Copying files from server to local computer using SSH
- Error “You must specify a region” when running any aws CLI command
- What is `S_ISREG()`, and what does it do?
- Using grep and ls -a commands
- Restarting cron after changing crontab file?
- Difference between sh and Bash
- cd into directory without having permission
- grep for special characters in Unix
- EC2 ssh Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
- Amazon Workspaces VM prevented from logging in to WordPress on DreamHost
- ssh returns “Bad owner or permissions on ~/.ssh/config”
- How do I change my private key passphrase?
- How do I get the current Unix time in milliseconds in Bash?
- Copying a large directory tree locally? cp or rsync?
- What’s the best way of handling permissions for Apache 2’s user www-data in /var/www?
- Permission denied (publickey). SSH from local Ubuntu to Amazon EC2 server
- Meaning of directories on Unix and Unix like systems
- How to get pid of just started process
- Why does my OpenSSH key fingerprint not match the AWS EC2 console keypair fingerprint?
- Can you have more than one ~/.ssh/config file?
- How to add a security group to a running EC2 Instance?
- How to disable everything in crontab -l?
- Why don’t EC2 ubuntu images have swap?
- Why is TCP accept() performance so bad under Xen?
- scp without known_hosts check
- How to sort ps output by process start time?
- Assign Public IP (not Elastic IP) after instance launched