Solved

When and how is  .ssh/  directory created?

Posted on 2006-10-23
10
220 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 50 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 50 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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

623 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