Is there any way to copy files to Appservice container over remote shell?

983 Views Asked by At

We were able to successfully connect to the Appservice container using the remote shell using below az command.

az webapp create-remote-connection --subscription ******** --resource-group myrg -n mywebapp &

we were able succesfully ssh to the appservice container with the given port with root user and password.

ssh [email protected] -p 359xx

But when we tried to copy files from local machine to the container,its throwing permission denied.

scp -p 359XX myfile [email protected]:/tmp/
2

There are 2 best solutions below

0
Robin D. On BEST ANSWER

I succeeded with:

rsync -az --bwlimit=500 -e 'ssh -p <port> -c aes256-cbc' ./database.sql.tar.gz [email protected]:~/

The --bwlimit bandwidth limit argument was the success factor.

In my case I had to specify the cypher algorithm(-c aes256-cbc) but if you can ssh without then in the rsync command you don't need it as well.

0
AudioBubble On

But when we tried to copy files from local machine to the container, its throwing permission denied

When enough permissions are not granted to access (read/write) the data from the local host (remote) to a server, then the permission denied comes:

enter image description here

If you want to copy specific files, then check and give the permissions using this command: chmod -R 777 filename because chmod -R 777 will gives all permissions to the root directory.

ssh -i ./downloads/filename.pem azureuser@IP_Address

Then copy the files using Secure Copy command scp -p xxxx filepath/filename webserverusername@ipaddress

Refer to one of the similar issues registered on AskUbuntu and many working solutions given by different authors.

Note: Another reason is in few of the Corporate Systems, Secure Shells (SSH) is restricted to use so that the error comes like permissions denied, TimedoutError, Internal server error.