# Asterisk Manager - Authentication failed

**URL:** <https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586>\
**Category:** Asterisk Support\
**Created:** [December 16, 2010, 2:25pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586 "2010-12-16T14:25:35Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincent\_](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vincent_/32/356_2.png) [@vincent\_](https://community.asterisk.org/u/vincent_)\
**Post date:** [December 16, 2010, 2:25pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/1 "2010-12-16T14:25:35Z")

</div>

Hi guys,

I’ve been spending all the day trying to connect to the Asterisk Manger but I still get this message :

ASTERISK MANAGER OUTPUT:  
Asterisk Call Manager/1.1  
Response: Error  
Message: Authentication failed

I’m getting crazy… so here is my config :

manager.conf

[general]  
enabled = yes  
port = 5038  
bindaddr = 127.0.0.1

[test]  
secret = test  
read = system,call,log,verbose,command,agent,user  
write = system,call,log,verbose,command,agent,user  
deny=0.0.0.0/0.0.0.0  
permit=127.0.0.1/255.255.255.255

http.conf

[general]  
enabled=yes  
enablestatic=yes  
bindaddr=0.0.0.0

What I’m doing :

$errno = “”;  
$errstr = “”;  
$timeout = “30”;

$socket = fsockopen(“127.0.0.1”,“5038”, $errno, $errstr, $timeout);  
fputs($socket, “Action: Login\r\n”);  
fputs($socket, “UserName: test\r\n”);  
fputs($socket, “Secret: test\r\n\r\n”);  
fputs($socket, “\r\n”);  
fputs($socket, “\r\n\r\n”);  
fputs($socket, “Action: ListCommands\r\n\r\n”);  
fputs($socket, “Action: Logoff\r\n\r\n”);  
while (!feof($socket)) {  
$wrets .= fread($socket, 4096);  
}  
fclose($socket);  
echo “ASTERISK MANAGER OUTPUT:$wrets”;

My server is located on a public adress : 91.121.72.X

It’s very important, Could you please help me ?

Thank you 1000 times !

Vincent.

---

<div class="post-metadata">

**Author:** ![malcolmd](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/malcolmd/32/5_2.png) [@malcolmd](https://community.asterisk.org/u/malcolmd)\
**Post date:** [December 16, 2010, 2:50pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/2 "2010-12-16T14:50:23Z")

</div>

Howdy,

Here’s my manager.conf:

```auto
[general]
displaysystemname=yes
enabled=yes
webenabled=no
port=5038
bindaddr = 127.0.0.1
[admin]
secret = admin
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.255
read = system,call,log,verbose,command,agent,user,config
write=system,call,log,verbose,command,agent,user,config
```

And I use the same test php code that you did:

```auto
<?php

$errno = "";
$errstr = "";
$timeout = "30";

$socket = fsockopen("127.0.0.1","5038", $errno, $errstr, $timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n");
fputs($socket, "Secret: admin\r\n\r\n");
fputs($socket, "Action: ListCommands\r\n\r\n");
fputs($socket, "Action: Logoff\r\n\r\n");
while (!feof($socket)) {
$wrets .= fread($socket, 4096);
}
fclose($socket);
echo "ASTERISK MANAGER OUTPUT:$wrets";
?>
```

And my output, from running the script locally, e.g. “php test.php” is:

```auto
root@host:/etc/asterisk/scripts# php text.php 
ASTERISK MANAGER OUTPUT:Asterisk Call Manager/1.1
Response: Success
Message: Authentication accepted

Event: FullyBooted
Privilege: system,all
Status: Fully Booted

Response: Success
WaitEvent: Wait for an event to occur. (Priv: <none>)
...
<snip>
...
DataGet: Retrieve the data api tree. (Priv: <none>)

Response: Goodbye
Message: Thanks for all the fish.
```

I’m using 1.8 out of SVN.

---

<div class="post-metadata">

**Author:** ![vincent\_](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vincent_/32/356_2.png) [@vincent\_](https://community.asterisk.org/u/vincent_)\
**Post date:** [December 16, 2010, 3:25pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/3 "2010-12-16T15:25:51Z")

</div>

Hi,

The problem persist, is my html.conf correct ?

The script is located in my folder /var/www/

Is there anyway to see why it doesn’t work ?

Thank you very much for you help,

Vincent.

---

<div class="post-metadata">

**Author:** ![malcolmd](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/malcolmd/32/5_2.png) [@malcolmd](https://community.asterisk.org/u/malcolmd)\
**Post date:** [December 16, 2010, 3:31pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/4 "2010-12-16T15:31:11Z")

</div>

That php code is from a web page?

Are you running that http server on the same server as Asterisk is running?

---

<div class="post-metadata">

**Author:** ![vincent\_](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vincent_/32/356_2.png) [@vincent\_](https://community.asterisk.org/u/vincent_)\
**Post date:** [December 16, 2010, 6:01pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/5 "2010-12-16T18:01:34Z")

</div>

yes… it is from a web page on the same server that asterisk is running

---

<div class="post-metadata">

**Author:** ![vincent\_](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vincent_/32/356_2.png) [@vincent\_](https://community.asterisk.org/u/vincent_)\
**Post date:** [December 16, 2010, 6:15pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/6 "2010-12-16T18:15:47Z")

</div>

I did it exactly the same way, I created test.php into etc/asterisk/script/  
I ran it and the output is still the same ☹

---

<div class="post-metadata">

**Author:** ![drivefast](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@drivefast](https://community.asterisk.org/u/drivefast)\
**Post date:** [December 16, 2010, 6:19pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/7 "2010-12-16T18:19:33Z")

</div>

may sound stupid, but i always forget to do it: after you added [test] in your manager.conf, did you restarted asterisk?

---

<div class="post-metadata">

**Author:** ![vincent\_](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vincent_/32/356_2.png) [@vincent\_](https://community.asterisk.org/u/vincent_)\
**Post date:** [December 16, 2010, 6:27pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/8 "2010-12-16T18:27:01Z")

</div>

in my log I can see that :

[Dec 16 19:17:39] WARNING[23113] cel\_manager.c: Failed to load configuration file. CEL manager Module not activated.

Is it important ?

and the command manager show user admin :

ns351866\*CLI\> manager show user admin

```
   username: admin
     secret: <Set>
        acl: yes
  read perm: system,call,log,verbose,command,agent,user,config,all
 write perm: system,call,log,verbose,command,agent,user,config,all

```

displayconnects: yes

it looks ok…but it doesn’t work

---

<div class="post-metadata">

**Author:** ![vincent\_](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vincent_/32/356_2.png) [@vincent\_](https://community.asterisk.org/u/vincent_)\
**Post date:** [December 16, 2010, 6:28pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/9 "2010-12-16T18:28:18Z")

</div>

yes i restarted Asterisk 😄

---

<div class="post-metadata">

**Author:** ![drivefast](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@drivefast](https://community.asterisk.org/u/drivefast)\
**Post date:** [December 16, 2010, 6:35pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/10 "2010-12-16T18:35:47Z")

</div>

you should probably be more concerned about what “manager show user test” says.

take it step by step. open telnet to port 5038 from your machine. type “Action: LoginUserName: test” and so on. see what you get. what’s the output from your php script?

---

<div class="post-metadata">

**Author:** ![vincent\_](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vincent_/32/356_2.png) [@vincent\_](https://community.asterisk.org/u/vincent_)\
**Post date:** [December 16, 2010, 6:56pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/11 "2010-12-16T18:56:53Z")

</div>

I just did it and got :

Reponse: Error  
Message: Permission denied

---

<div class="post-metadata">

**Author:** ![vincent\_](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vincent_/32/356_2.png) [@vincent\_](https://community.asterisk.org/u/vincent_)\
**Post date:** [December 16, 2010, 7:08pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/12 "2010-12-16T19:08:27Z")

</div>

I’m getting crazy, I don’t know what to do ☹  
I don’t have a clue I triedeverything

---

<div class="post-metadata">

**Author:** ![vincent\_](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vincent_/32/356_2.png) [@vincent\_](https://community.asterisk.org/u/vincent_)\
**Post date:** [December 16, 2010, 7:12pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/13 "2010-12-16T19:12:14Z")

</div>

\*CLI\> manager show users

## username

## admin test

2 manager users configured.  
\*CLI\> manager show user test

```
   username: test
     secret: <Set>
        acl: yes
  read perm: system,call,log,verbose,command,agent,user,config,all
 write perm: system,call,log,verbose,command,agent,user,config,all

```

displayconnects: yes

They are both configured… it should work no ?

\<?php $errno = ""; $errstr = ""; $timeout = "30"; $socket = fsockopen("127.0.0.1","5038", $errno, $errstr, $timeout); fputs($socket, "Action: Login\r\n"); fputs($socket, "UserName: test\r\n"); fputs($socket, "Secret: test\r\n\r\n"); fputs($socket, "Action: ListCommands\r\n\r\n"); fputs($socket, "Action: Logoff\r\n\r\n"); while (!feof($socket)) { $wrets .= fread($socket, 4096); } fclose($socket); echo "ASTERISK MANAGER OUTPUT:$wrets"; ?\>

Is my http.conf wrong ?

[general]  
enabled=yes  
enablestatic=yes  
bindaddr=0.0.0.0

---

<div class="post-metadata">

**Author:** ![drivefast](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@drivefast](https://community.asterisk.org/u/drivefast)\
**Post date:** [December 16, 2010, 7:39pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/14 "2010-12-16T19:39:44Z")

</div>

http.conf is out of question for now, as the trouble is that your “test” user is simply not granted access to the AMI. i dont know if theres something else that could prevent manager logins… maybe some setting in asterisk.conf? i doubt it. also, try enabling debug in manager.conf (add a “debug=yes” line under [general]), maybe that will give you some more clues

---

<div class="post-metadata">

**Author:** ![malcolmd](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/malcolmd/32/5_2.png) [@malcolmd](https://community.asterisk.org/u/malcolmd)\
**Post date:** [December 16, 2010, 7:40pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/15 "2010-12-16T19:40:51Z")

</div>

Why are you trying to enable Asterisk’s http server? Your PHP script is running on some other server, connecting to Asterisk’s manager interface. Where is the Asterisk http interface a part of this?

By default manager.conf does not enable the http server, that’s done by setting webenabled=yes.

Cheers.

---

<div class="post-metadata">

**Author:** ![vincent\_](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vincent_/32/356_2.png) [@vincent\_](https://community.asterisk.org/u/vincent_)\
**Post date:** [December 17, 2010, 1:28pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/16 "2010-12-17T13:28:13Z")

</div>

Hi guys,

I tried to connect through telnet, I get the same error message :

Response: Error Message: Authentication failed

Is there a way to get the manager logins debug ?

I clearly have configured

[test]  
secret=test  
deny=0.0.0.0/0.0.0.0  
permit=127.0.0.1/255.255.255.255  
read = system,call,log,verbose,command,agent,user,config  
write=system,call,log,verbose,command,agent,user,config

\*CLI\> manager show user test  
username: test  
secret:   
acl: yes  
read perm: system,call,log,verbose,command,agent,user,config,all  
write perm: system,call,log,verbose,command,agent,user,config,all  
displayconnects: yes

It’s awful, there’s no way to authenticate ☹  
Is there any trustful person who would like to have a look at it directly ?

thank you very much !

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [June 30, 2013, 3:21am UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/17 "2013-06-30T03:21:43Z")

</div>

try something very simple. I’ve got the same problem and then realized that my server ip was not informed on manager.conf

```auto
[admin]
secret = 123
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
permit=YOUR_SERVER_IP/255.255.255.0
read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
write = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
```

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 22, 2026, 9:39pm UTC](https://community.asterisk.org/t/asterisk-manager-authentication-failed/33586/19 "2026-01-22T21:39:23Z")

</div>

Closed on January 22, 2026, 9:39pm UTC


