Solved

When and how is  .ssh/  directory created?

Posted on 2006-10-23
10
203 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
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
parse convert xml feed to text (python) 2 69
Sendmail STARTTLS error 37 83
AWS CLI - Issue with name display 2 51
Centos 6 User Can't Assign Password 2 25
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…
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…

920 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

13 Experts available now in Live!

Get 1:1 Help Now