Issue in solving task 04 for level01 git


Facing issue of permission denied can anyone help me to resolve this issue

User natasha does not have write access to /usr/src - you need to be root.

1 Like

I made natasha root user by changing ownership by commond chown natasha@ip address
i complete all process but at the end error is that you have updated more in /usr/src/kodekloudrepos .what i can do now i try my best but still on level 04

That isn’t the way to do it. You scp the file to the host’s /tmp or home directory then ssh into the host, become root and do the rest of the steps.

2 Likes

storage server …natasha
jump server …/tmp cat /etc/passwd
sudo su
natasha to be owner ?
sudo su
cd /usr/src/kodekloudrepos
ls -la
command change group and owner
chown natasha ecommerce/
ls -la
sudo scp index.html [email protected]:/usr/src/kodekloudrepos/official

git add ecommerce/index.html
git commit -m “Add index.html file”
git push origin master
i used in this way but at the end it shows error
seems like you updated some unwanted configuration in
‘/usr/src/kodekloudrepos/ecommerce’ Git repository on Storage Server

You don’t change permissions, you use sudo to become root:

sudo -i
1 Like

before scp ?
and rest process is right?
Thanks For Replying

Yes, copy the file to the host and then login to the host and as root do the rest of the steps.

@al1 @CloudIndia-123 This worked for me

I sshed into the storage server as natasha, then i used the following command

scp thor@jump_host:/tmp/index.html .

The above command copies the file from jump_host to home directory of natasha (storage server)

Then sudo -i

cp /home/natasha/index.html /usr/src/kodekloudrepos/games

Finally,

git add index.html
git commit -m “add index.html”
git push origin -u master