Search code examples
linuxsshremote-accessscp

open file from remote host with Kate


Is it possible to open a file from a remote host with Kate like you can with vim:
vim scp://root@cc3//var/log/dp.log?
I've tried the following but neither option seems to work:
kate scp://root@cc3//var/log/dp.log & and kate fish://root@cc3//var/log/dp.log &


Solution

  • By design, Kate interacts with user by dialogs, while you can also start editing a file in kate from command line with:

    kate /file/to/open
    

    Please do note that if you are not inside the kde/plasme desktop enviroment, kate may not be able to handle external files.

    In this case, you can mount a remote filesystem with sshfs.

    Example:

    sshfs -p PORT_NUMBER USERNAME@SERVER:/path/to/remote/filesystem /mnt/remote_filesystem
    

    Once done, you'll be able to:

    kate /mnt/remote_filesystem/file_to_edit_with_kate
    

    Following suggestion in comments, you can also install the kio-extra libraries, problably not available on your no-kde desktop

    sudo apt update
    sudo apt install kio-extras
    

    Restarting your kate, you'll have your remote connections at hand inside the "+ Other locations" tab

    enter image description here