For this you have to have ssh access configured and host setted up. Also you have to have credentials to the mysql database connection and database where will be intalles test tables.
Once you have all setted up and ready connect to your website using ssh and open your website root folder (usually its public_html or www).
Then launch one by one commands below.

 tar -zxvf magento-
 tar -zxvf magento-sample-data-
 mv magento-sample-data-* magento/media/
 mv magento-sample-data- magento/magento_sample_data_for_1.9.0.0.sql
 mv magento/* magento/.htaccess .
 chmod -R o+w var var/.htaccess app/etc
 chmod -R o+w media
 chmod 755 mage
 mysql -h localhost -u <database_username> -p <database_name> < magento_sample_data_for_1.9.0.0.sql
 rm -rf magento_sample_data_for_1.9.0.0.sql magento-sample-data- magento-sample-data- magento- magento-sample-data-

 The first two lines will download archives and second two lines will unpack it.
 The 5th-7th lines will move all files into website folder.
 The lines 8th - 10th will set up magento default folder permissions.
 On the line 11th you need to replace <database_username> with your username for the mysql connection. If your server located at different host you also need to replace localhost with mysql database server address. The <database_name> should be replaced with your store database.