Announcement

Collapse
No announcement yet.

[SOLVED] curlftpfs "secure" automatic login multiple sites (shell script)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] curlftpfs "secure" automatic login multiple sites (shell script)

    Hi.

    I am trying to figure out how to manage "secure" automatic log in via curlftpfs to multiple sites via shell script.

    I think I will use something like this:
    curlftpfs ftp://example01.comassword@example01.com ~/ftp/example01.com/
    curlftpfs ftp://example02.comassword@example02.com ~/ftp/example02.com/
    curlftpfs ftp://example03.comassword@example03.com ~/ftp/example03.com/
    .
    .
    .

    I would like to be able to store the password in a secure place, like in a root only access folder. I still must be able to execute the script as user, so I can work in the ftp folders as the normal user.

    The cool thing here would be, if I only will be prompted for a single password, for example root password.

    Any hints ideas?

    *EDIT*
    After some thinking I have come up with the folowing solution.

    make a shell script:
    Code:
    #!/bin/sh
    
    pass1=`sudo sed -n '1p' ~/secure/read.txt`
    curlftpfs ftp://example1.com:$pass1@example1.com ~/ftp/example1.com
    pass2=`sudo sed -n '2p' ~/secure/read.txt`
    curlftpfs ftp://example2.com:$pass2@example2.com ~/ftp/example2.com/
    edit your read.txt
    Code:
    secretpass1
    secretpass2
    secure your secure folder or only read.txt
    Code:
    sudo chown root:root secure/ -R
    sudo chmod go= secure/ -R
    This should do the trick. If you have multiple ftp sites, you have access to them all by supplying only your root password. Still your passwords though not encrypted are only readable by root.

    Any hints or tricks are very welcome
    Check out my Ⓥegan youtube channel PlantSugar
    CV and gallery at grn.dk
    Please add [SOLVED] to topic subject when topic is solved.
Working...
X