Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

When and how is  .ssh/  directory created?

Posted on 2006-10-23
10
Medium Priority
?
232 Views
Last Modified: 2013-12-06

Hello all,

I know that .ssh/ will be created when a user does ssh first time to a server but this doesn't happen under fedora?
What is the deal with .ssh/  under root  directory?

Should I create it manually or there is a way to make it up? ONCE agin this is about Fedora.

Thanks.
0
Comment
Question by:akohan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
10 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 17792951
Are you absolutely sure it doesn't get created for root?  It does for me.

Are you sure you're looking in

/root/.ssh

0
 

Author Comment

by:akohan
ID: 17793037

Yes! I was expecting it to be created as you did but no. Yes, ran  ls  -la

it is not there.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 17793080
So as root, when you ssh each time to the same server it should give you the usual ssh message about the server not being known, presenting the fingerprint and asking you to confirm whether to procede.  Is that correct?
0
Quick Cloud Training

Looking for some quick training on the cloud in 2 hours or less? Check out these how-to guides in AWS, Linux, OpenStack, Azure, and more!

 

Author Comment

by:akohan
ID: 17793689

No. it seems there is a misunderstanding.

Ok. Let's say we have two machines. Machine A and B;  A is your local server and B is a new freshly installed machine.
1) I run  "ssh-keygen -t rsa "  command under /root/.ssh
2) it creates a rsa_key.pub file
3) id_rsa.pub is generated under /root/.ssh/
3) since I need to make a trusted hosts connection I will scp the file in step 3 onto machine B :
   # scp /root/.ssh/id_rsa.pub   root@IP_OF_Machine_B:/root/.ssh

Problem: .ssh/ doesn't exist under /root

How can I create it on Machine B? except manual method? there must be a solid and systematic way to have B create it.

Any comment?

Thanks

0
 
LVL 43

Accepted Solution

by:
ravenpl earned 200 total points
ID: 17793875
> How can I create it on Machine B? except manual method? there must be a solid and systematic way to have B create it.
No, there's not. Some distributions put this directory into user's skeleton - but not all (/etc/skel)
ssh - while using will creast this dir for saving known_hosts (same applies to ssh-keygen)
Otherwise, create by hand, but follows rules
mkdir $HOME/.ssh && chmod 0700 $HOME/.ssh
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 200 total points
ID: 17794200
Step 3 is the easiest most systematic way of doing it.
0
 

Author Comment

by:akohan
ID: 17799217


I found that this could happen on some distriubtion that OS makes the .ssh/ directory but mostly root has to make it.

0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question