LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-08-2016, 07:02 AM   #1
vishawdeep
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Rep: Reputation: Disabled
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
 
Old 03-08-2016, 07:09 AM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,653

Rep: Reputation: 569Reputation: 569Reputation: 569Reputation: 569Reputation: 569Reputation: 569
???

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.
 
1 members found this post helpful.
Old 03-08-2016, 07:15 AM   #3
vishawdeep
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
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
 
Old 03-08-2016, 07:28 AM   #4
vishawdeep
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
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".
 
Old 03-08-2016, 09:44 AM   #5
vishawdeep
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Unhappy Problem using SFTP to copy files onto server

Why no replies............
 
Old 03-08-2016, 10:02 AM   #6
hydrurga
Senior Member
 
Registered: Nov 2008
Distribution: Linux Mint 18 MATE
Posts: 1,212

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
What is the output if you use the command

Code:
lls
?
 
Old 03-08-2016, 10:07 AM   #7
vishawdeep
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
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.
 
Old 03-08-2016, 10:14 AM   #8
hydrurga
Senior Member
 
Registered: Nov 2008
Distribution: Linux Mint 18 MATE
Posts: 1,212

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Ok, how about

Code:
lpwd
?
 
Old 03-08-2016, 10:16 AM   #9
vishawdeep
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Problem using SFTP to copy files onto server

the output was "Local working directory: /root"
 
Old 03-08-2016, 10:27 AM   #10
hydrurga
Senior Member
 
Registered: Nov 2008
Distribution: Linux Mint 18 MATE
Posts: 1,212

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Quote:
Originally Posted by vishawdeep View Post
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.
 
Old 03-08-2016, 10:31 AM   #11
vishawdeep
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Problem using SFTP to copy files onto server

I opened a new console, cd Desktop, then pwd, output was /home/argo/Desktop.
 
Old 03-08-2016, 10:36 AM   #12
hydrurga
Senior Member
 
Registered: Nov 2008
Distribution: Linux Mint 18 MATE
Posts: 1,212

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Quote:
Originally Posted by vishawdeep View Post
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
 
Old 03-08-2016, 10:39 AM   #13
vishawdeep
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
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?
 
Old 03-08-2016, 10:40 AM   #14
hydrurga
Senior Member
 
Registered: Nov 2008
Distribution: Linux Mint 18 MATE
Posts: 1,212

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Quote:
Originally Posted by vishawdeep View Post
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.
 
Old 03-08-2016, 10:44 AM   #15
hydrurga
Senior Member
 
Registered: Nov 2008
Distribution: Linux Mint 18 MATE
Posts: 1,212

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Quote:
Originally Posted by vishawdeep View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to list files when connected to another server using SFTP in an automated script cmovva Linux - Newbie 3 02-11-2013 03:46 PM
how to copy files from server to server with root login disabled ? ratotopi Linux - Newbie 3 10-13-2012 01:44 PM
how to copy files to another server cj4331 Linux - Newbie 19 03-19-2008 08:28 AM
Copy files from my PC to server anjanesh Linux - Newbie 6 12-30-2005 01:28 AM
Files truncated by sftp/sftp-server at 65kb gato Linux - Networking 1 12-18-2003 11:29 AM


All times are GMT -5. The time now is 06:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration