Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Laravel 4 Basics Getting Started with Laravel Installing Laravel Homestead

Cannot see a .ssh folder when typing the ls -la command

I was typing ls -la command but I can not find a .ssh folder inside

provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys: - ~/.ssh/id_rsa

folders: - map: ~/Code to: /home/vagrant/Code

sites: - map: homestead.app to: /home/vagrant/Code/Laravel/public

databases: - homestead

variables: - key: APP_ENV value: local

Make sure you're using that command from the root of your project.

2 Answers

This appears to be a file rather than a directory. Run "file .ssh" to be sure. Then try deleting and re-creating it:

rm .ssh
mkdir .ssh
ls -ld .ssh
file .ssh

You should see something like the following:

drwxrwxr-x 2 Mike staff 4096 Jun  5 16:23 .ssh
.ssh: directory 

The first 'd' shows that it is a directory. The rest of the initial string shows the owner permissions (Mike can read, write, execute), group permissions (staff can read, write, execute), and the other permissions (everyone else can read, not write, execute). A directory has to have the 'd' flag set, and can only be listed by an account that has the read and execute bits set. See the chmod command on how to change these.

Yeah! Thanks! It works!!!

But after I change directory to the folder and then try to list the files using "ls", there is nothing inside.

The command I input is "MikesdeMacBook-Pro:.ssh Mike$ ls" but nothing happens. It should have the "id_rsa" or "id_rsa.pub". But I got nothing in this folder. What shall I do to fix this problems? Sorry, I am new to command line and thank you so much to your kind help!

Creating keys is covered in the video at the 3:43 mark.

First, make sure that you are in your home directory and look for the .ssh directory.

cd ~
ls -ld .ssh

If it is not there, simply create it and look at the permissions

mkdir .ssh
ls -ld .ssh

Make sure that the directory is not open for writing by the public, i.e. that the last letters of the permissions sting are "r-x".

This is the result of typing:

cd ~
ls -ld .ssh

The result is:

MikesdeMacBook-Pro:~ Mike$ cd ~
MikesdeMacBook-Pro:~ Mike$ ls -ld .ssh
-rw-------  1 Mike  staff  1675 Jun 19 00:53 .ssh
MikesdeMacBook-Pro:~ Mike$ cd .ssh
-bash: cd: .ssh: Not a directory

This is what the command line displays:

MikesdeMacBook-Pro:~ Mike$ cd ~
MikesdeMacBook-Pro:~ Mike$ ls -ld .ssh
-rw-------  1 Mike  staff  1675 Jun 19 00:53 .ssh

Is it the problem of "-rw-------"? I am not sure whether it means that I have no permission to enter the folder