Quantcast

Using a different cookie path

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Using a different cookie path

Lionel Cons

I would like to control which cookie Erlang will use. In my

environment, it's not practical to let Erlang use ~/.erlang.cookie.

 

I've found the -setcookie option for erl but this takes the cookie

itself, not a file path. This is insecure since any user could list

the Unix processes and see the cookie on the command line.

 

Is there a way to tell Erlang to get its cookie from a file other than

~/.erlang.cookie?

 

Thanks in adavnce for your advices,

 

Lionel


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Using a different cookie path

Michael Santos-2
On Wed, Jun 29, 2011 at 11:04:04AM +0000, Lionel Cons wrote:
> I would like to control which cookie Erlang will use. In my
> environment, it's not practical to let Erlang use ~/.erlang.cookie.
>
> I've found the -setcookie option for erl but this takes the cookie
> itself, not a file path. This is insecure since any user could list
> the Unix processes and see the cookie on the command line.

Erlang cookie auth really isn't secure anyway.

> Is there a way to tell Erlang to get its cookie from a file other than
> ~/.erlang.cookie?

    {ok, Cookie} = file:read_file("/path/to/cookie"),
    erlang:set_cookie(binary_to_atom(Cookie, latin1)).

> Thanks in adavnce for your advices,
>
> Lionel
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Using a different cookie path

Tim Watson-5
On 29 June 2011 12:53, Michael Santos <[hidden email]> wrote:
> On Wed, Jun 29, 2011 at 11:04:04AM +0000, Lionel Cons wrote:
>> I would like to control which cookie Erlang will use. In my
>> environment, it's not practical to let Erlang use ~/.erlang.cookie.
>>
>> I've found the -setcookie option for erl but this takes the cookie
>> itself, not a file path. This is insecure since any user could list
>> the Unix processes and see the cookie on the command line.
>
> Erlang cookie auth really isn't secure anyway.

This is definitely true.

>
>> Is there a way to tell Erlang to get its cookie from a file other than
>> ~/.erlang.cookie?
>

There is another option. Pass -vmargs pointing to a 'vmargs' file
which contains the -setcookie option. This (cookie) won't appear on
the command line, although the path to the vmargs file will,
obviously.
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Loading...