LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-14-2015, 01:40 PM   #1
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Posts: 56

Rep: Reputation: Disabled
Passing password to encfs


There is an option in encfs:

--extpass=program Use external program for password prompt

I want to use such program for this:

#!/bin/bash
zenity --entry --title="password dialog" --text="Enter your _password:" --hide-text

But how can I pass such obtained password to entfs call?

Any idea?
 
Old 03-15-2015, 07:01 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Couple of things, really. First of all you know about "--extpass=" because you read about it somewhere. If you don't know what or how then the first thing would be to 'man encfs' to learn about using it. The manual page should show an example so you could test that. If you're satisfied it works as advertised you could leave it at that. If not, then the manual tells you the only requirement is the application printing the pass phrase on stdout. That's something you can test with the command you suggested and then just pass --extpass='/apth/to/yourscript.sh' as argument.
 
Old 03-15-2015, 07:18 AM   #3
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Posts: 56

Original Poster
Rep: Reputation: Disabled
I read it, so finally I got it working.

Main script looks like this:

Code:
#!/bin/bash
sudo encfs --extpass=/home/maciek/Pobrane/zen --public /home/maciek/dir/.dir_c /home/maciek/dir_v >/dev/null 2>/dev/null
status=$?
if test $status -eq 0
then
mount /home/maciek/.ssh
zenity --timeout=10 --info --text "Poczono SSH"
exit
else
umount /home/maciek/.ssh 2>/dev/null
sudo fusermount -u ~/dir_v 2>/dev/null
zenity --timeout=10 --error --text "Rozczono SSH lub bdne haso"
fi



Where "zen" script is:

Code:
#!/bin/bash
xhost local:maciek > /dev/null
zenity --entry --title="password dialog" --text="wprowa haso do SSH:" --hide-text



So i placed icon on pulpit, linked to main script. But I must set in "konsole" options "Run in terminal" (KDE environment). In other case, script always fails that is "zen" script does not start.
Is any possibility to hide or turn off terminal window during call such script?
 
Old 03-15-2015, 08:34 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Maybe create a .desktop file for it in ~/.local/share/applications/ and set "Terminal=false"?
 
Old 06-23-2015, 12:21 PM   #5
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Posts: 56

Original Poster
Rep: Reputation: Disabled
Commenting the line in /etc/sudoers, containing

#Defaults requiretty

resolved the problem!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] EncFS failure (NFS export of a reverse encfs mount) Skaperen Linux - Software 2 04-29-2011 02:51 PM
Passing SSH a password through command line info1686 Linux - General 5 08-05-2010 01:17 AM
[SOLVED] Passing another program a password and username felix001 Programming 15 05-14-2010 10:56 AM
passing a password to su?? s2cuts Linux - General 6 02-20-2008 03:30 PM
LXer: Dual password encryption with EncFS LXer Syndicated Linux News 0 06-23-2007 01:46 PM


All times are GMT -5. The time now is 09:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration