Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bluetooth proximity detection?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Sat Sep 23, 2006 8:10 pm    Post subject: bluetooth proximity detection? Reply with quote

My friend mentioned to me that someone he knew had his gentoo set up to detect his bluetooth phone and log him in to his computer when he was in range. I did a few searches but couldn't find any resources in these forums.

Has anyone done this? I was thinking it would be fun to mess around with, maybe even have my computer announce when I get home.

I found a thing called Asterisk@Home that does kind of what I want, I just don't want the phone forawrding stuff.
Back to top
View user's profile Send private message
beatryder
Veteran
Veteran


Joined: 08 Apr 2005
Posts: 1138

PostPosted: Sun Sep 24, 2006 12:29 am    Post subject: Reply with quote

you might want to have a look at this:

http://pam.0xdef.net/

http://forums.gentoo.org/viewtopic-t-305540-highlight-.html
_________________
Dont make it idiot proof, make it work.
Neucode.org
<suppressed key>
Back to top
View user's profile Send private message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Sun Sep 24, 2006 4:57 am    Post subject: Reply with quote

Hey thanks for the links. That points me in the right direction. Unfortunately, neither of those two options work. I got them all set up and configured but when one or the other is enabled I can not log in at all.

I also found http://perl.jonallen.info/projects/bluetooth
which seems usefull but I haven't tried it yet.
Back to top
View user's profile Send private message
beatryder
Veteran
Veteran


Joined: 08 Apr 2005
Posts: 1138

PostPosted: Sun Sep 24, 2006 5:09 am    Post subject: Reply with quote

How are you configuring pam_blue?

I just finished fighting with pam_usb so I have become somewhat familiar with it. If you don't mind posting your configs here. Perhaps I could help you?
_________________
Dont make it idiot proof, make it work.
Neucode.org
<suppressed key>
Back to top
View user's profile Send private message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Sun Sep 24, 2006 5:52 am    Post subject: Reply with quote

There isn't much documentation on it. This is what I have in the "/etc/security/bluescan.conf" file.

Code:

###########################################################
#
#   sample bluescan.conf configuration file
#   $Id: sample.conf 3 2004-04-18 23:32:18Z pfeifer $
#
###########################################################


general {
    # the normal timeout for scanning
    # watch out for a to tiny timeslot for scanning
    # values between 4 and 15 seconds are valid
    timeout = 4;
}

xamindar = {

    # bluetooth device name
    name    = Jared`s LG CU500;

    # bluetooth mac address
    bluemac = 00:12:56:5A:92:59;

    # a seaparate timeout
    timeout = 10;
}



Also, a question about pam_usb. In the logs it keeps spitting out:
Code:

[device.c:74] Directory /proc/scsi/usb-storage-0/ not found
[pam.c:198] Device not valid.
[pam.c:138] Searching the utmp entry for tty tty2...
[pam.c:152] Authentication request from tty2 ()
[device.c:74] Directory /proc/scsi/usb-storage-0/ not found
[pam.c:198] Device not valid.
[pam.c:138] Searching the utmp entry for tty tty2...
[pam.c:152] Authentication request from tty2 ()
[device.c:74] Directory /proc/scsi/usb-storage-0/ not found
[pam.c:198] Device not valid.


Shouldn't it be looking for "/proc/scsi/usb-storage/0" instead?
Back to top
View user's profile Send private message
beatryder
Veteran
Veteran


Joined: 08 Apr 2005
Posts: 1138

PostPosted: Sun Sep 24, 2006 5:59 am    Post subject: Reply with quote

Hmm, I dunno. You should be using pam_blue though, not pam_usb...

This is what my pam config, I am currently only using pam_usb but you may want to have something similar to this with pam_blue. Obviously you will have to use different parameters.
Quote:
Osiris ryan # cat /etc/pam.d/system-auth
#%PAM-1.0

auth required pam_env.so
auth sufficient pam_usb.so fs=vfat !check_device !check_if_mounted log_file=/var/log/pam_usb.log force_device=/dev/key
auth sufficient pam_unix.so likeauth nullok
auth required pam_deny.so

account required pam_unix.so

password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
password sufficient pam_unix.so nullok md5 shadow use_authtok
password required pam_deny.so

session required pam_limits.so
session required pam_unix.so

_________________
Dont make it idiot proof, make it work.
Neucode.org
<suppressed key>
Back to top
View user's profile Send private message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Sun Sep 24, 2006 6:05 am    Post subject: Reply with quote

Here is my /etc/pam.d/system-auth at the moment
Code:
#%PAM-1.0

#added by me
#auth       required     /lib/security/pam_blue.so debug
#auth       required     pam_usb.so force_device=/dev/sda1  fs=vfat check_if_mounted=1 debug=1 log_file=/var/log/pam_usb.log

## possible uses
# 1. Unique
# auth required pam_usb.so
# 2. Alternative
# auth sufficient pam_usb.so
# 3. Additional
# auth required pam_usb.so


auth       required     pam_env.so
auth       sufficient   pam_unix.so likeauth nullok
auth       required     pam_deny.so

account    required     pam_unix.so

password   required     pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
password   sufficient   pam_unix.so nullok md5 shadow use_authtok
password   required     pam_deny.so

session    required     pam_limits.so
session    required     pam_unix.so


Thanks for the help. I guess I'll just mess around with it and hopefully figure out what's wrong.
Back to top
View user's profile Send private message
beatryder
Veteran
Veteran


Joined: 08 Apr 2005
Posts: 1138

PostPosted: Sun Sep 24, 2006 6:15 am    Post subject: Reply with quote

Quote:
#auth required /lib/security/pam_blue.so debug
#auth required pam_usb.so force_device=/dev/sda1 fs=vfat check_if_mounted=1 debug=1 log_file=/var/log/pam_usb.log

Are those commented out by default? Also I found that I had better luck getting the pam_usb to work when I did not specify the "force_device=" once i got it working (pam_usb tries sd* when not force_device is not set) I set up a udev rule to make life easier.

One thing I would suggest trying is this:
change
Quote:
#auth required /lib/security/pam_blue.so debug

to
Quote:
auth [bold]sufficient[/bold] pam_blue.so debug


Setting that as sufficient and placing it above the line containing "pam_unix.so" will set it such that all you need to do is enter your user name, and if the pam_blue auth works you will be logged in. Try this at a TTY
(ie: ctrl+alt+F1) if it does not, then you will still be able to login with your password. Then once you get it all working you can change it back to required.

I am gonna play with pam_blue next weekend (no time now, work/school/gf), if I get it working I will post my config and some troubleshooting tips if I have any.
_________________
Dont make it idiot proof, make it work.
Neucode.org
<suppressed key>
Back to top
View user's profile Send private message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Sun Sep 24, 2006 7:07 am    Post subject: Reply with quote

They are commented because they don't work.

using sufficient is a good tip. I originally had that but nothing changed so I tried using required and then I couldn't log in at all. So at least I now know that the thing is doing *SOMETHING*. I look forward to finding out if you are able to get it working. I will keep on it and post if I have any success.
Back to top
View user's profile Send private message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Sun Sep 24, 2006 7:38 am    Post subject: Reply with quote

OK, my log is saying things such as this when I try to log in.

Code:
Sep 24 00:37:16 [pam_blue] Can't parse configuration file [_+__�!��_____]!/etc/security/bluesscan.conf


I went through the config file and removed all comments and made it as clean as I could but it still does that. Anyone have any ideas?
Back to top
View user's profile Send private message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Sun Sep 24, 2006 8:15 am    Post subject: Reply with quote

Eh, I guess it's time for bed. I tried creating a simple script to announce when I came in but even that doesn't work.
Code:
#!/bin/bash
ANNOUNCE=/home/xamindar/hello.txt
GOODBYE=/home/xamindar/bye.txt
HOME=`hcitool scan | grep -c 00:12:56:5A:92:59`
if [ "$HOME" == "1" ]; then
     festival --tts $ANNOUNCE
fi

if [ "$HOME" == "0" ]; then
     festival --tts $GOODBYE
fi



fextival spits out the following in the console:
Code:
xamindar@lain ~/Desktop $ ./home_announce.sh
1/.esd_auth: No such file or directory
ESD: error writing - Bad file descriptor


What a frustrating night.
Back to top
View user's profile Send private message
beatryder
Veteran
Veteran


Joined: 08 Apr 2005
Posts: 1138

PostPosted: Sun Sep 24, 2006 4:23 pm    Post subject: Reply with quote

Check the permissions on the config file.
_________________
Dont make it idiot proof, make it work.
Neucode.org
<suppressed key>
Back to top
View user's profile Send private message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Sun Sep 24, 2006 10:25 pm    Post subject: Reply with quote

beatryder wrote:
Check the permissions on the config file.


I tried making it world everything and it still did it. Oh well. It must be outdated.
Back to top
View user's profile Send private message
beatryder
Veteran
Veteran


Joined: 08 Apr 2005
Posts: 1138

PostPosted: Sun Sep 24, 2006 10:37 pm    Post subject: Reply with quote

Have you tried contacting the original developer?
_________________
Dont make it idiot proof, make it work.
Neucode.org
<suppressed key>
Back to top
View user's profile Send private message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Mon Sep 25, 2006 7:54 am    Post subject: Reply with quote

Yeah, I sent an email to him. We'll see. I did end up getting a fun little script working that will welcome me home when I enter my room with my phone. Used flite instead of stupid festival and it worked. So I'm content with that for now. I'll mess around with bash scripting in the next week and try to make something more usefull.

And I did finally get the usb authentication working. Thanks to your suggestions. Nice to be able to plug it in and not need a password to login.
Back to top
View user's profile Send private message
jcbray
n00b
n00b


Joined: 04 May 2006
Posts: 62

PostPosted: Mon Sep 25, 2006 8:40 am    Post subject: Reply with quote

is there an ebuild for pam blue? i couldn't find one...I did see the manual download from the link, but an ebuild is always easier!

EDIT: Nevermind, I went ahead and just did it manually...can't get it to work either :P
Back to top
View user's profile Send private message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Mon Sep 25, 2006 5:35 pm    Post subject: Reply with quote

jcbray wrote:
is there an ebuild for pam blue? i couldn't find one...I did see the manual download from the link, but an ebuild is always easier!

EDIT: Nevermind, I went ahead and just did it manually...can't get it to work either :P


Do you get the same errors in your everything log as I do? Something about not being able to parse the config?
Back to top
View user's profile Send private message
jcbray
n00b
n00b


Joined: 04 May 2006
Posts: 62

PostPosted: Mon Sep 25, 2006 5:53 pm    Post subject: Reply with quote

yup!
Code:
Sep 26 03:47:17 localhost pam_blue[15885]: Can't parse configuration file [XÀ   ˆ»ÊMП   ]!/etc/security/bluesscan.conf


The documentation for this isn't great, been trying to set up an sms system too, not having much luck there either though.
Back to top
View user's profile Send private message
lkraav
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2004
Posts: 107
Location: Estonia

PostPosted: Sat Apr 21, 2012 1:48 pm    Post subject: Reply with quote

do you guys have any special characters in your usernames?

i'm finding pam_blue-0.9.0 can't parse a configuration file with username "anna-maria".
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum