Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)

When I run the command asterisk -r I get that :handshake:

Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)

But I’ve created a user for it and allowed permition like that:

useradd -d /var/lib/asterisk asterisk
chown -R asterisk /var/spool/asterisk /var/lib/asterisk /var/run/asterisk

Although I did that I can’t run it
#asterisk-17.3.0

thats telling you asterisk is not running

if you run the following do you see otherwise ?

ps aux | grep sbin/asterisk

asterisk must be running to connect with -r … you can su to asterisk user and run asterisk -vvvvvc in order to confirm it can start and from another session connect recursively … once confirmed you need to figure out whats going on with your startup script

Make sure selinux is disabled

You can also get this error if the user executing ‘asterisk -r’ does not have permissions to the socket.

Try executing ‘asterisk -r’ as either the user executing the daemon or as root.

Wouldn’t hurt to confirm the path to the socket is where you think it is:

sudo lsof -c asterisk | grep unix

Yes with your command I’ve got that:

root 1825 0.0 0.0 12944 976 pts/0 S+ 10:13 0:00 grep --color=auto sbin/asterisk
The process asterisk isn’t launched but How can I contact the user asterisk in the order to run asterisk -vvvvvvvc

Yes of course selinux is desabled