Scp: /usr/src/kodekloudrepos/demo//index.html: Permission denied

The Nautilus development team started with new project development. They have created different Git repositories to manage respective project’s source code. One of the repositories /opt/demo.git was created recently. The team has given us a sample index.html file that is currently present on jump host under /tmp directory. The repository has been cloned at /usr/src/kodekloudrepos on storage server in Stratos DC.

Copy sample index.html file from jump host to storage server under cloned repository at /usr/src/kodekloudrepos/demo, further add/commit the file and push to the master branch.

I have tried the below steps but it’s not working. Am I missing something ?

thor@jump_host ~$ sudo scp /tmp/index.html natasha@ststor01:/usr/src/kodekloudrepos/demo/

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for thor:
The authenticity of host ‘ststor01 (172.16.238.15)’ can’t be established.
ECDSA key fingerprint is SHA256:0roYEqNfPBAS6MeEiNu1vyY5mveDCvk6Z4ZPaY0WHGg.
ECDSA key fingerprint is MD5:ee:c3:4b:50:44:91:94:d6:e3:59:3c:dc:a2:35:67:81.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘ststor01,172.16.238.15’ (ECDSA) to the list of known hosts.
natasha@ststor01’s password:
scp: /usr/src/kodekloudrepos/demo//index.html: Permission denied

Hi @uwithnishad,
Please copy this file somewhere under /tmp/. For that location, the user doesn’t have enough permission.

Regards,

Hi @Tej-Singh-Rana
I have changed the required permission already in Natasha server but still did not worked at all.
I would appreciate if you provide me the steps to resolve this issue.

Hi @uwithnishad,
What is the task name?

Hi @uwithnishad,
As I said in the previous comment, copy the file to the /tmp/ location.

Please find the attached screenshot.

@Tej-Singh-Rana Okay. Let me try once.
Thanks…

Hi @Tej-Singh-Rana,
Finally, the task is done by following your instruction to copy the file to the /tmp/ location.
Below are the steps to complete this task.

scp /tmp/index.html natasha@ststor01:/tmp/
ssh natatsha@ststor01
sudo mv /tmp/index.html /usr/src/kodekloudrepos/games
cd /usr/src/kodekloudrepos/games
git add index.html
git commit -m “Add sample index.html file”
git push origin master

However, I have one more doubt to clear. Have I misunderstood the question Or is the question wrong in itself? Please clear my doubts.

1 Like