LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem using SFTP to copy files onto server (https://www.linuxquestions.org/questions/linux-newbie-8/problem-using-sftp-to-copy-files-onto-server-4175574296/)

vishawdeep 03-08-2016 06:02 AM

Problem using SFTP to copy files onto server
 
I am getting error stat : no such file or directory"
index.html file is thr on desktop of my ubuntu VM,
same error for folders.

"put Desktop/index.html" is the command m using

wpeckham 03-08-2016 06:09 AM

???
 
1. Did you have a question?

2. The problem information is interesting. If you DO have a question, you might want to provide the command line and some detail about the process. Remember to use code tags to make sure the code format is preserved.

vishawdeep 03-08-2016 06:15 AM

I am learning how to use sftp to transfer files from my ubuntu machine to my webserver, I was following an online tutorial, I logged into my webserver using command " ssh sftp root@1.1.1.1".
then I went to var/www/html and according to tutorial i gave the command "sftp> put Desktop/index.html". which resulted in error "stat Desktop/index.html: No such file or directory". The file is there on my desktop and name is also correct.
My question is how can i solve this.
Thanks

vishawdeep 03-08-2016 06:28 AM

Problem using SFTP to copy files onto server
 
I was trying to copy files from my ubuntu VM to my webserver using sftp, i logged into webserver using " ssh sftp root@1.1.1.1", went to var/www/html
and gave this command "sftp>put Desktop/index.html". thats where i got the error "stat Desktop/index.html: no such file or directory". How can i solve this.
The file name is correct and i also tried "put home/argo/Desktop/index.html".

vishawdeep 03-08-2016 08:44 AM

Problem using SFTP to copy files onto server
 
Why no replies............

hydrurga 03-08-2016 09:02 AM

What is the output if you use the command

Code:

lls
?

vishawdeep 03-08-2016 09:07 AM

Problem using SFTP to copy files onto server
 
nothing,
sftp> lls
sftp>

i am running it on VM(hyper-v) so i dont know how to copy paste it from thr, but nothing happend when i entered that command.

hydrurga 03-08-2016 09:14 AM

Ok, how about

Code:

lpwd
?

vishawdeep 03-08-2016 09:16 AM

Problem using SFTP to copy files onto server
 
the output was "Local working directory: /root"

hydrurga 03-08-2016 09:27 AM

Quote:

Originally Posted by vishawdeep (Post 5512128)
the output was "Local working directory: /root"

Ok, using the command prompt, go and look to see if you have either:

/root/Desktop/index.html

or

/root/home/argo/Desktop/index.html

which were the two files you attempted to put.

vishawdeep 03-08-2016 09:31 AM

Problem using SFTP to copy files onto server
 
I opened a new console, cd Desktop, then pwd, output was /home/argo/Desktop.

hydrurga 03-08-2016 09:36 AM

Quote:

Originally Posted by vishawdeep (Post 5512138)
I opened a new console, cd Desktop, then pwd, output was /home/argo/Desktop.

But that's not what ssh is pointing at. Because you appear to be running ssh as root, it's pointing at /root, not your user home directory.

Either run ssh as a normal user (you), or check out the lcd command here:

http://www.tutorialspoint.com/unix_commands/sftp.htm

vishawdeep 03-08-2016 09:39 AM

Problem using SFTP to copy files onto server
 
but root is the only user on my server at the moment, should i change the directory path to my desktop?

hydrurga 03-08-2016 09:40 AM

Quote:

Originally Posted by vishawdeep (Post 5512138)
I opened a new console, cd Desktop, then pwd, output was /home/argo/Desktop.

Which was not what I asked you to do. :)

I asked you to go and see if

/root/Desktop/index.html

or

/root/home/argo/Desktop/index.html

existed, so that you could understand what the problem was.

hydrurga 03-08-2016 09:44 AM

Quote:

Originally Posted by vishawdeep (Post 5512142)
but root is the only user on my server at the moment, should i change the directory path to my desktop?

Might be worth a shot.


All times are GMT -5. The time now is 05:04 AM.