sftp get not working as expected

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm trying to download a folder from a remote server to my local server but I'm getting unexpected results.



I used this to sftp:



$ sftp -P [the_port] user@remote_ip


this got me into the server. I then tried using this:



$ get -r /home/user/public_html/images/ /var/www/mySite/


However, it returns the error:




mkdir /var/www/mySite: Permission denied




which doesn't make sense to me, according to here I should be able to use get like this:




get [-P] remote-path [local-path]




but it seems it's trying to get the remote-path and place it on the remote-server. Using autocomplete confirms this, doing:




/var/ (tab) -> shows the www dir as expected

/var/www/ (tab) -> shows none of my local machine's /var/www/ folders.




Where am I going wrong in using the get command?










share|improve this question























  • @fra-san in the past I've used tab and it shows my local system path? and how do I check if I have permissions
    – treyBake
    2 days ago











  • Showing local paths with tab in sftp prompt? I am not able to reproduce, nor to find hints on how to do that. About permissions: try getting the remote site somewhere in your /home/your_user/ directory. In a standard setup you will have to be root to put it in /var/www/ (or the user that runs a web server and owns /var/www, if you have one).
    – fra-san
    2 days ago











  • Correction about completion: if it is enabled, it will tab-complete both remote and local paths in command lines as sftp user@host:/remote/path /local/path (of course, public key, or otherwise password-less, authentication must be enabled). Tab-completion in a sftp prompt will complete only remote paths after the command get and only local paths after the command put. Tested on bash and zsh.
    – fra-san
    yesterday















up vote
0
down vote

favorite












I'm trying to download a folder from a remote server to my local server but I'm getting unexpected results.



I used this to sftp:



$ sftp -P [the_port] user@remote_ip


this got me into the server. I then tried using this:



$ get -r /home/user/public_html/images/ /var/www/mySite/


However, it returns the error:




mkdir /var/www/mySite: Permission denied




which doesn't make sense to me, according to here I should be able to use get like this:




get [-P] remote-path [local-path]




but it seems it's trying to get the remote-path and place it on the remote-server. Using autocomplete confirms this, doing:




/var/ (tab) -> shows the www dir as expected

/var/www/ (tab) -> shows none of my local machine's /var/www/ folders.




Where am I going wrong in using the get command?










share|improve this question























  • @fra-san in the past I've used tab and it shows my local system path? and how do I check if I have permissions
    – treyBake
    2 days ago











  • Showing local paths with tab in sftp prompt? I am not able to reproduce, nor to find hints on how to do that. About permissions: try getting the remote site somewhere in your /home/your_user/ directory. In a standard setup you will have to be root to put it in /var/www/ (or the user that runs a web server and owns /var/www, if you have one).
    – fra-san
    2 days ago











  • Correction about completion: if it is enabled, it will tab-complete both remote and local paths in command lines as sftp user@host:/remote/path /local/path (of course, public key, or otherwise password-less, authentication must be enabled). Tab-completion in a sftp prompt will complete only remote paths after the command get and only local paths after the command put. Tested on bash and zsh.
    – fra-san
    yesterday













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm trying to download a folder from a remote server to my local server but I'm getting unexpected results.



I used this to sftp:



$ sftp -P [the_port] user@remote_ip


this got me into the server. I then tried using this:



$ get -r /home/user/public_html/images/ /var/www/mySite/


However, it returns the error:




mkdir /var/www/mySite: Permission denied




which doesn't make sense to me, according to here I should be able to use get like this:




get [-P] remote-path [local-path]




but it seems it's trying to get the remote-path and place it on the remote-server. Using autocomplete confirms this, doing:




/var/ (tab) -> shows the www dir as expected

/var/www/ (tab) -> shows none of my local machine's /var/www/ folders.




Where am I going wrong in using the get command?










share|improve this question















I'm trying to download a folder from a remote server to my local server but I'm getting unexpected results.



I used this to sftp:



$ sftp -P [the_port] user@remote_ip


this got me into the server. I then tried using this:



$ get -r /home/user/public_html/images/ /var/www/mySite/


However, it returns the error:




mkdir /var/www/mySite: Permission denied




which doesn't make sense to me, according to here I should be able to use get like this:




get [-P] remote-path [local-path]




but it seems it's trying to get the remote-path and place it on the remote-server. Using autocomplete confirms this, doing:




/var/ (tab) -> shows the www dir as expected

/var/www/ (tab) -> shows none of my local machine's /var/www/ folders.




Where am I going wrong in using the get command?







linux permissions sftp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









Jeff Schaller

36k952119




36k952119










asked 2 days ago









treyBake

229112




229112











  • @fra-san in the past I've used tab and it shows my local system path? and how do I check if I have permissions
    – treyBake
    2 days ago











  • Showing local paths with tab in sftp prompt? I am not able to reproduce, nor to find hints on how to do that. About permissions: try getting the remote site somewhere in your /home/your_user/ directory. In a standard setup you will have to be root to put it in /var/www/ (or the user that runs a web server and owns /var/www, if you have one).
    – fra-san
    2 days ago











  • Correction about completion: if it is enabled, it will tab-complete both remote and local paths in command lines as sftp user@host:/remote/path /local/path (of course, public key, or otherwise password-less, authentication must be enabled). Tab-completion in a sftp prompt will complete only remote paths after the command get and only local paths after the command put. Tested on bash and zsh.
    – fra-san
    yesterday

















  • @fra-san in the past I've used tab and it shows my local system path? and how do I check if I have permissions
    – treyBake
    2 days ago











  • Showing local paths with tab in sftp prompt? I am not able to reproduce, nor to find hints on how to do that. About permissions: try getting the remote site somewhere in your /home/your_user/ directory. In a standard setup you will have to be root to put it in /var/www/ (or the user that runs a web server and owns /var/www, if you have one).
    – fra-san
    2 days ago











  • Correction about completion: if it is enabled, it will tab-complete both remote and local paths in command lines as sftp user@host:/remote/path /local/path (of course, public key, or otherwise password-less, authentication must be enabled). Tab-completion in a sftp prompt will complete only remote paths after the command get and only local paths after the command put. Tested on bash and zsh.
    – fra-san
    yesterday
















@fra-san in the past I've used tab and it shows my local system path? and how do I check if I have permissions
– treyBake
2 days ago





@fra-san in the past I've used tab and it shows my local system path? and how do I check if I have permissions
– treyBake
2 days ago













Showing local paths with tab in sftp prompt? I am not able to reproduce, nor to find hints on how to do that. About permissions: try getting the remote site somewhere in your /home/your_user/ directory. In a standard setup you will have to be root to put it in /var/www/ (or the user that runs a web server and owns /var/www, if you have one).
– fra-san
2 days ago





Showing local paths with tab in sftp prompt? I am not able to reproduce, nor to find hints on how to do that. About permissions: try getting the remote site somewhere in your /home/your_user/ directory. In a standard setup you will have to be root to put it in /var/www/ (or the user that runs a web server and owns /var/www, if you have one).
– fra-san
2 days ago













Correction about completion: if it is enabled, it will tab-complete both remote and local paths in command lines as sftp user@host:/remote/path /local/path (of course, public key, or otherwise password-less, authentication must be enabled). Tab-completion in a sftp prompt will complete only remote paths after the command get and only local paths after the command put. Tested on bash and zsh.
– fra-san
yesterday





Correction about completion: if it is enabled, it will tab-complete both remote and local paths in command lines as sftp user@host:/remote/path /local/path (of course, public key, or otherwise password-less, authentication must be enabled). Tab-completion in a sftp prompt will complete only remote paths after the command get and only local paths after the command put. Tested on bash and zsh.
– fra-san
yesterday
















active

oldest

votes











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482128%2fsftp-get-not-working-as-expected%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482128%2fsftp-get-not-working-as-expected%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay