Solved

When and how is  .ssh/  directory created?

Posted on 2006-10-23
10
202 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
  • 3
  • 3
10 Comments
 
LVL 48

Expert Comment

by:Tintin
Comment Utility
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
Comment Utility

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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:akohan
Comment Utility

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
Comment Utility
> 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
Comment Utility
Step 3 is the easiest most systematic way of doing it.
0
 

Author Comment

by:akohan
Comment Utility


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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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 …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now