LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackpkg FTP login (https://www.linuxquestions.org/questions/slackware-14/slackpkg-ftp-login-4175593034/)

pchristy 11-06-2016 10:34 AM

Slackpkg FTP login
 
I have 3 machines running slack 64 current, and I have a portable drive on which I keep an up-to-date mirror for updating my machines.

My new router (TP-Link WD-9980) has facilities for NAS, and it seemed to me that a better solution would be to put my mirror on NAS, so that I could update whatever machine I happened to be on, without carrying a portable device around - and forgetting to put it back when finished!

Unfortunately, the ftp server for the NAS doesn't appear to allow anonymous logins. The smb server does, but slackpkg doesn't appear to support smb. And I can't find where slackpkg stores its ftp login information. It doesn't appear to be in either the .conf or mirrors files.

Does anyone know how to make slackpkg login non-anonymously? Or am I on a loser here?

TIA,

--
Pete

Emerson 11-06-2016 10:42 AM

In Gentoo I put portage on NFS and mount the share from every box. Why keep a local copy of everything, right? You should be able to do it in Slackware, too. Does your NAS have NFS?

pchristy 11-06-2016 10:50 AM

Yes, that's what I'm trying to achieve. Sadly, the NAS only supports ftp and smb. Slackpkg supports ftp, but not smb, so it looks like I'm stuck with ftp.

It *ought* to work, as it will log anonymously into ftp servers on the net, but the NAS doesn't appear to support logins without a password - fairly sensible, I suspect! But I can't find where to set a password for ftp in slackpkg!

Thanks for your assistance!

--
Pete

Emerson 11-06-2016 11:07 AM

For normal users you can set FTP password in ~/.netrc, what user runs slackpkg?

pchristy 11-06-2016 11:12 AM

Slackpkg has to be run as root (its updating system files). I'm sure it must have ftp login configured somewhere, but I can't find it!

I don't have .netrc in my user account. Normally, for ftp transfers I use gftp. My network connections are managed by NetworkManager.

Thanks for the suggestion! Keep 'em coming! :study:

--
Pete

Emerson 11-06-2016 11:14 AM

You can create ~/.netrc and its contents will be read by FTP client.

bassmadrigal 11-06-2016 09:16 PM

Can you just use the normal ftp login:password option in your /etc/slackpkg/mirrors?

Code:

ftp://username:password@192.168.1.1/slackware/slackware64-current/

pchristy 11-07-2016 02:56 AM

D'oh! Of course!

Why do I always look for a complex answer when there's a simple one staring me in the face?

Many thanks! That worked perfectly!

Now all I have to do is work out how to sync the NAS with the mirror. rsync cant handle two network connections at once it appears. Can lftp do this? or ftpsync? Any suggestions?

Cheers,

--
Pete

Slax-Dude 11-07-2016 06:21 AM

Quote:

Originally Posted by pchristy (Post 5627633)
I have a portable drive on which I keep an up-to-date mirror for updating my machines.

Quote:

Originally Posted by pchristy (Post 5627855)
Now all I have to do is work out how to sync the NAS with the mirror.

How were you keeping the portable drive updated? Could you not use this method to update your NAS?

pchristy 11-07-2016 07:42 AM

I use rsync to update the portable drive, and that works well. Unfortunately, rsync doesn't seem support a non-local destination directory. I've had a go using lftp, which I *almost* got to work - I'm struggling a bit with the syntax. However, the NAS supports smb as well as ftp, so it looks as if I might be able to mount the NAS via smb, so that it looks like a local directory, and then use rsync as at present.

I'm going to have a go at that later today - got some chores to do first!

--
Pete

bassmadrigal 11-07-2016 07:59 AM

You could use curlftpfs to mount an FTP directory locally. It'd make rsync much easier.

Code:

curlftpfs 192.168.1.1 /mnt/NAS/ -o user=username:password,allow_other
You could create an fstab entry to have it mounted automatically.

Code:

curlftpfs#user:password@192.168.1.1 /mnt/NAS fuse defaults,allow_other,_netdev 0 0

pchristy 11-07-2016 09:51 AM

Yes, that looks like a good possibility too! Indeed, reading the info, it seems to have advantages over smb. It will be tomorrow before I get chance to compile it though - I seem to be running out of free time today!

Many thanks for the pointers!

--
Pete

SCerovec 11-07-2016 10:16 AM

Quote:

Originally Posted by bassmadrigal (Post 5627939)
You could use curlftpfs to mount an FTP directory locally. It'd make rsync much easier.

Code:

curlftpfs 192.168.1.1 /mnt/NAS/ -o user=username:password,allow_other
You could create an fstab entry to have it mounted automatically.

Code:

curlftpfs#user:password@192.168.1.1 /mnt/NAS fuse defaults,allow_other,_netdev 0 0

this is most interesting man!
:hattip:

pchristy 11-08-2016 08:11 AM

Thanks to all for your help and advice! I've sort of managed to achieve what I want with both cifs and curlftpfs, but have run into issues with both - though not related to my original question! Unfortunately the "cheap and cheerful" NAS system that is part of my router only supports FAT and NTFS file systems as well, which gives me a headache when trying to copy the Slackware mirror to them (symlinks, etc).

Since this is wandering off the original topic, I'm going to start a new thread seeking advice on this issue. I'm sure what I'm attempting must be possible, and may be of interest to others fighting the built-in limitations of such a system.

Again, thanks to all those who have contributed responses to this thread.

--
Pete


All times are GMT -5. The time now is 02:12 AM.