Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I'm trying to automate uploading certain files to my network storage (ftp account). That's not a problem once I've run lftp, however, I want to write a script that would do it. For example, when I finish editing a file, I'd like to run a script, which will upload it to my network storege without specifying the username/password, etc.
the address is 192.168.1.102, and it uses port 1979
debug
open 192.168.1.102:1979
cd /data/notes/
lcd /home/xtd8865/notes/
put -a sshX
quit
Code:
$ lftp -f script.lftp
---- Resolving host address...
---- 3 addresses found
---- Connecting to 192.168.1.102 (192.168.1.102) port 1979
<--- 220 NET Disk FTP Server ready.
---> FEAT
<--- 530 Not logged in.
---> USER anonymous
<--- 230 User logged in, proceed.
---> FEAT
<--- 211- Extension supported:
<--- PASV
<--- SIZE
<--- 211 END
---> PWD
<--- 257 "/" is current directory.
---> CWD /data/notes
<--- 550 Requested action not taken.
cd: Access failed: 550 Requested action not taken. (/data/notes)
---> PASV
<--- 227 Entering Passive Mode (192,168,1,102,210,139).
---- Connecting data socket to (192.168.1.102) port 53899
---- Data connection established
---> ALLO 397
<--- 500 Syntax error, command unrecognized.
---> STOR sshX
<--- 550 Requested action not taken.
---- Closing data socket
put: Access failed: 550 Requested action not taken. (sshX)
---> QUIT
---- Closing control socket
sshX is the file I'm trying to transfer.
Then I thought perhaps there's something wrong with the directories, so I removed them from the 'script.lftp'
Code:
debug
open 192.168.1.102:1979
# cd /data/notes/
# lcd /home/xtd8865/notes/
put -a sshX
quit
Code:
$ lftp -f script.lftp
---- Resolving host address...
---- 3 addresses found
---- Connecting to 192.168.1.102 (192.168.1.102) port 1979
<--- 220 NET Disk FTP Server ready.
---> FEAT
<--- 530 Not logged in.
---> USER anonymous
<--- 230 User logged in, proceed.
---> FEAT
<--- 211- Extension supported:
<--- PASV
<--- SIZE
<--- 211 END
---> PWD
<--- 257 "/" is current directory.
---> PASV
<--- 227 Entering Passive Mode (192,168,1,102,210,149).
---- Connecting data socket to (192.168.1.102) port 53909
---- Data connection established
---> ALLO 397
<--- 500 Syntax error, command unrecognized.
---> STOR sshX
<--- 550 Requested action not taken.
---- Closing data socket
put: Access failed: 550 Requested action not taken. (sshX)
---> QUIT
---- Closing control socket
There shouldn't be any problems with permissions on the NAS. When I:
lftp sycamorex@192.168.1.102:1979
Once I'm in, that's where I'd like to put the file:
did you set the permissions to 0600 for ~/.netrc chmod 0600 ~/.netrc
if the permissions are not 0600 (if group or other have any permission bit set at all) then ~/.netrc is ignored for "security" reasons.
from the debug, it looks like lftp is attempting anonymous login (probably due to permission not being 0600 on ~/.netrc).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.