Install dependencies:

apt-get install git python-requests python-selenium gpac  

Get tool to acquire our activation bytes. These bytes will allow ffmpeg to decrypt the Audible aax files.

git clone https://github.com/inAudible-NG/audible-activator.git  
cd audible-activator  
wget http://chromedriver.storage.googleapis.com/2.21/chromedriver_linux64.zip  
unzip chromedriver_linux64.zip  

Install a version of ffmpeg that supports the new feature -activation_bytes

mkdir /usr/local/ffmpeg  
wget -O - http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz | tar Jxf -  
mv ffmpeg-3.0-64bit-static/* /usr/local/ffmpeg/  
for m in ffmpeg ffmpeg-10bit ffprobe ffserver qt-faststart; do ln -s /usr/local/ffmpeg/$m /usr/local/bin/$m; done  

Run audible_activator.py

./audible_activator.py
Username: user@example.com  
Password:  
CAFED00D  

Audible aax files are encoded with aac so you can do the following to copy the stream out of the aax into an mpeg4 container.

ACTIVATION_BYTES='CAFED00D'  
ffmpeg -activation_bytes ${ACTIVATION_BYTES} -i input.aax -vn -c:a copy output.m4a  

Unfortunately, this will not copy the album art along with the file. So we have to something like this:

Save the cover to a jpeg file

ffmpeg -activation_bytes ${ACTIVATION_BYTES} -i ${m} -an -vcodec copy cover.jpg  

Actually do the stream copy using the audio stream only.

ffmpeg -activation_bytes ${ACTIVATION_BYTES} -i ${m} -vn -c:a copy output.m4a  

Use the jpeg we created earlier and drop it into the converted file.

MP4Box -itags cover=cover.jpg output.m4a