0

Currently we are having Git repository which is configured with srvapps (service account).I can sudo to the Git server using this account (username - srvapps and password - my login password).

My application is running on the username "srvapps" and all the directories is owned by the srvapps:srvapps (username/group)

But for some reason, if do scp from my git server to application server to copy the new files, it says permission denied.

From my Git server - I have used following commands -

scp -r new_file srvapps@app1:\home_git\apps - Its asking for srvapps password.

scp -r new_file myuserid@app1:\home_git\apps - It says permission denied.

Could you pls let me know, what i am doing wrong here?

6
  • Your description is very poorly worded, I have read it 5 times and am still unclear what you're a) trying to achieve and b) why being prompted for a password is a problem. Commented Dec 14, 2018 at 17:04
  • Sorry for the bad description. Commented Dec 14, 2018 at 20:12
  • Basically, I have Git server. I make the configuration changes on the Git server and then i need to copy the changes it to the App server. when i copy it (as explained above), its either asking for password or says permission denied. a) - i need to copy the files from git server to app server. b) service account (srvapps) doesnt have password. So i dont know what password to put. Also, when i used my_login_id, it says permission denied. The owner (user) of the git directory is srvapps. The directory which i need to copy, owner (user) is srvapps Commented Dec 14, 2018 at 20:29
  • On the app server - can you ssh to the app server as yourself? And become the service account? Commented Dec 14, 2018 at 20:33
  • I cant ssh in to the box with the srvapps account (sudo ssh srvapps@appserver1. but if i login to the server, first with my account then i can use sudo su - srvapps and login as the service account user. Commented Dec 14, 2018 at 23:03

1 Answer 1

0

ssh into the app server, become the app user sudo su - srvapps

Then copy across from git server scp -r myuserid@git:/path/to/files .

2
  • Thanks for your answer. I did some research as well. I didnt find any other solution. Also, the problem is that before copying the files i need to login to other server all the time (we have nearly 30 servers in 5 tiers) each tier has different set of code. The other option is to use, ssh keys. Commented Dec 15, 2018 at 16:46
  • That would be a sensible solution. Or you could use ansible - but those are things you could have mentioned in your question to get a better response ... ;) Commented Dec 15, 2018 at 16:58

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.