Results 1 to 4 of 4

Thread: .desktop script password

  1. #1
    Join Date
    Dec 2011
    Beans
    4

    .desktop script password

    I have a script to mount 3 sshfs shares. It works from xfce .desktop, or terminal in either environment, but not from kde .desktop. The shares require a password. I know I could use keys, but for this case I want to use passwords. In terminal I get a password prompt sequentially for each share as the line is executed. Upon providing the last password I can go to file manager and access my shares. With xfce .desktop I automatically get 3 sequential password dialogs. Upon providing the final password I can go to file manager and see shares. With kde .desktop the script executes with no dialogs and no shares are mounted. If I test in terminal I get three password prompts. Upon providing last password shares are mounted. Going back to .desktop I find execute in terminal. This behaves much like default settings. I see terminal flash up for a second then close. No shares mounted. I go back to advanced settings, check remain open after completion. Now terminal stays open, I get the 3 prompts. I asssume the passwords are going through because I get the next password prompt without error. Providing the wrong password does generate an error, or using the advanced settings to change the user provides a connection reset error from the server. However when I get the 3 sequential prompts and provide the correct password each time, the terminal "hangs" after the last prompt. Presumably because I told it not to close after completion, but the shares aren't created. After force closing the terminal no shares are created. Any thoughts on specific issue? Any thoughts on differences between how xfce handles .desktop files vs how kde handles .desktop files in general?

  2. #2
    Join Date
    Jul 2012
    Location
    Illinois, USA
    Beans
    508
    Distro
    Ubuntu 12.04 Precise Pangolin

    Lightbulb Re: .desktop script password

    You can have SSH ask you for the password graphically. I believe this is what you're looking for:
    http://unix.stackexchange.com/questi...key-passphrase

  3. #3
    Join Date
    Dec 2011
    Beans
    4

    Re: .desktop script password

    Thanks for the reply Kirk. I found similar posts, but found them confusing. I ended up perceiving this as only for a key pair protected by a passphrase, rather than just a password. Still not sure if it handles both cases or just the keypair protected by passphrase. I ended up resolving by combining the elements of two other solutions I found through google:

    #!/bin/bash
    password=`kdialog --password "Password"`
    if [ $? = 0 ]; then
    echo $password | sshfs user@server:/mnt/folder1 /media/folder1 -o password_stdin
    echo $password | sshfs user@server:/mnt/folder2 /media/folder2 -o password_stdin
    echo $password | sshfs user@server:/mnt/folder3 /media/folder3 -o password_stdin
    else
    ""
    fi
    Last edited by gear64; October 1st, 2013 at 01:29 AM. Reason: spellcheck

  4. #4
    Join Date
    Jul 2012
    Location
    Illinois, USA
    Beans
    508
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: .desktop script password

    Yeah, that'll do the trick. I thought about suggesting Zenity, but suggesting using SSH Askpass seemed like a better initial solution. I'm glad you got everything working!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •