Linux Remote Copy - Wrong

Hello All , @Inderpreet @KodeKloud @kodekloud-support3

I am getting Permission Denied .
Please let me what wrong here


I can see extra space between @ and 172 ip addr. That should be like banner@172.16.238.12

As per hint if you will face scp command is not found error then you have to install openssh-clients package in app server 3 as per task description.

Because of space between remote username and IP, if you notice the shell uses jump host user to connect to App03 which is causing the issue for you on authentication i believe. As you might be entering password for banner user but system picked local which is thor for scp.

Thank you @player001
I also noticed it
Task is Success

Thank you @smartclick
I also noticed it
Task is Success

1 Like


Hi Team, iam getting permission denied message i gave full permissions for nautilus.txt.gdg with chmod 777 .

thor@jump_host /tmp$ scp nautilus.txt.gpg banner@172.16.238.12:/home/data
The authenticity of host ‘172.16.238.12 (172.16.238.12)’ can’t be established.
ECDSA key fingerprint is SHA256:SySamszyWhhLGFiybhGBqfrr8g55wS/3e37ZpBOvICs.
ECDSA key fingerprint is MD5:6d:31:18:2a:f9:07:f3:29:dd:0a:d3:1f:6e:04:0a:db.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘172.16.238.12’ (ECDSA) to the list of known hosts.
banner@172.16.238.12’s password:
scp: /home/data/nautilus.txt.gpg: Permission denied

@Inderpreet @KodeKloud @kodekloud-support3 Any update on this?

Task completed successfully with below steps.

$ chmod 777 /tmp/nautilus.txt.gpg

$ sudo scp /tmp/nautilus.txt.gpg steve@172.16.238.11:/tmp

ssh steve@stapp02

ls -al

sudo cp /tmp/nautilus.txt.gpg /home/appdata

ls -al

exit

You may need to install openssh-clients for ssh based operations.

How to do this …I have entered sudo apt-get install openssh-client …so the are saying Command not found. Is this necessary to do …???

I only complete the task when transfer file to tmp dir and locally copy to right dir.

1 Like

The remote directory is owned by root so you can’t use scp to transfer file directly into it. The simplest way is to use temporary destination with scp and then move the file. Another way is to use ansible copy module :slight_smile:

@abhipatil99 that’s because it’s Centos and you should to use yum package manager. Learn the difference between Debian based and RHEL based distributions.

2 Likes

Login to the app-3 node
switch to root user
# sudo su -
create a folder inside the /tmp
# mkdir /tmp/test
change the permission
# chmod -R 777 /tmp/test

Copy the file from jump host to app3 node

In Jump host
# cd /tmp
# scp nautilus.txt.gdg user@<app3-node-ip/hostname>:/tmp/test
Login to the app3 node
# cd /tmp/test
# cp nautilus.txt.gdg /home/webapp
delete the test folder from /tmp
# rm -rf /tmp/test

1 Like

@abhipatil99 you should use “yum install -y openssh-clients” command to install this package on centos.

1 Like

Tutorial with screenshots for beginners: Linux Remote Copy KodeKloud Solution

Hello, shawon10
Kindly update your copyrights year. It’s 2020 not 2014.

thanks it’s worked fine