Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools

Using ssh to copy a public_html file and place the copied file into my Virtualbox ubuntu machine

Hi anyone. I am trying to copy my Joomla website to my Virtualbox. I have already gathered the database and files using ssh and downloaded to my machine. I just need to copy rhe database and web files from my machine and place into my Virtualbox - ubuntu machine using ssh. I am fairly new to using all these programs, etc. But I enjoying learning new skills.

2 Answers

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 27,918 Points

Can you ssh from the machine to the virtual box or vice-versa?

If so, then you can probably use 'scp' or 'sftp' utilities.

Here I demonstrate a simple example of scp

treehouse:~/workspace$ scp                                                                             
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]                               
           [-l limit] [-o ssh_option] [-P port] [-S program]                                           
           [[user@]host1:]file1 ... [[user@]host2:]file2 

Now... lets copy a file from treehouse to a remote host

treehouse:~/workspace$ ls                                                                              
assets create_daily.py  monster.py  __pycache__  shop.py

We choose 'monster.py'

treehouse:~/workspace$ scp monster.py jeff@somedomain.net:~/monster.py                                    
jeff@somedomain.com's password:                                                                           
monster.py                                                           100%   80     0.1KB/s   00:00     

Now... what if we want to transfer a whole directory called "assets" to the other server and put it in your 'home' directory... scp has you covered with the '-r' switch

treehouse:~/workspace$ scp -r assets jeff@somedomain.net:~                                                
jeff@somedomain.net's password:                                                                           
test.html                                                            100%   15     0.0KB/s   00:00     
another.html                                                         100%   20     0.0KB/s   00:00

Thanks Jeff for answering. Sincere apologies for this late reply. I had been away to see relatives.

I'm relatively new to Treehouse so I haven't answered questions or posted any questions before this one. Using ssh is further than my achievements so far on Treehouse. This question relates to something on a different project. The only way to learn is to tackle projects beyond your level.

I can ssh from my machine to my Virtualbox. I log into my ubuntu server that way.

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 27,918 Points

I am a casual VirtualBox user -- Ubuntu is a great choice for an environment either as a host or client operating system.

VMWare performs better (I use it at work), but the price of "free" for VirtualBox makes it pretty compelling for home projects.

Thanks Jeff.

I have only recently downloaded VirtualBox as I use it at work. I'm a junior web developer but I'm have not been long in the position. This is my first web dev job. I began to use VirtualBox at work so I wanted to download it at home for my windows laptop to practice more with it especially with ubuntu. As I am relatively new to VirtualBox and ubuntu, I don't know of many projects as of yet (apart from the one I asked recently) I can do in my spare time to get my experience level up. Using Cygwin, ssh and cmd to execute commands is something I would like to have more experience with also.