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 trialMike Zhu
1,840 PointsCannot 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
Brandon Mowat
8,186 PointsMake sure you're using that command from the root of your project.
2 Answers
Tom Sager
18,987 PointsThis 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.
Mike Zhu
1,840 PointsYeah! Thanks! It works!!!
Mike Zhu
1,840 PointsBut 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!
Tom Sager
18,987 PointsCreating keys is covered in the video at the 3:43 mark.
Tom Sager
18,987 PointsFirst, 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".
Mike Zhu
1,840 PointsThis 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
Mike Zhu
1,840 PointsThis 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
Mike Zhu
1,840 PointsIs it the problem of "-rw-------"? I am not sure whether it means that I have no permission to enter the folder
Mike Zhu
1,840 PointsMike Zhu
1,840 Pointsprovider: 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