Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    Using FTP usernames with @-symbol in midnight commander

    7th May 2009

    MC is a console file manager. It supports FTP connections, and in my experience is faster in FTP than both Krusader and Gnome Commander.

    However, the default FTP connection format string [username[:password]@]hostname has a drawback of not allowing the use of usernames with ‘@’-symbol in them – which is very common for virtual hostings.

    One of the solutions is (done in your home directory):

    1. if there is no .netrc file in your home directory — touch .netrc && chmod 600 .netrc
    2. mcedit .netrc (or use vi, nano, or any other editor you prefer)
    3. add the following line to the file (replace all-caps words with your actual credentials): machine HOSTNAME login USER@HOSTNAME password PASSWORD

    Now, start MC, choose FTP connect, and enter only the hostname. You will be automatically logged in to the remote FTP.
    This will also work for console ftp clients like lftp.

    Share

    One Response to “Using FTP usernames with @-symbol in midnight commander”

    1. Запуск файлов из Midnight Commander (MC) | CetLot Says:

      [...] Using FTP username with @-symbol in it in midnight commander [...]

    Leave a Reply

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>