These were the steps I used to install drush globally using composer in Linux (not in ~/.composer/vendor/bin logged in as root which makes absolutely no sense):
- Login as root
- Install composer if necessary. See. http://getcomposer.org/doc/00-intro.md#system-requirements.
- composer global require drush/drush:6.* or composer global require drush/drush:dev-master
- cd ~/.composer
- composer config --global bin-dir /usr/local/bin
- composer config --global vendor-dir /usr/local/share
- composer install
- cp -r vendor/ /usr/local/share/drush/drush/
- cd /usr/local/share/drush/drush
- composer install
Now any user with /usr/local/bin in their path can run drush. Security
Security precaution: You might want to chown and chmod /usr/local/bin/drush so only authorized users in a certain group can execute drush.
Notes: Lines 5 and 6 create the file ~/.composer/config.json. Line 10 is needed to delete (yes, delete) the /usr/local/share/drush/drush/vendor/drush folder which is unnecessary.