lost in the file system

Hi everybody,

This is my first post here. I installed FreeBSD and FreeNAS on my old PC. I had problems to implement passwordless ssh dialog between the FreeNAS server and my Windows computers, that's why I decided to learn a little about FreeBSD and FreeBSD commands in order to debug this a little (I am almost a linux newbie).

I installed openssh on my Windows 7 PC and as a first try I wanted to have a look at what is in the sshd_config file. The FreeNAS GUI, which has a "file manager" shows me when I log in as the root user, that there is indeed, starting from the top, a /etc/ssh/sshd_config path to the file, but the GUI does not allow to look inside the file. Never mind, with my openssh shell, I shoud be able to do it, shouldn't I? Well, it seems I am not :O

I logged in from my Windows PC with
Code:
ssh root@freenas
root@freenas's password: xxx

Welcome etc.
Then I try to know where I am
Code:
freenas:~# pwd
/root
OK then I should see my /etc directory, no?
Code:
freenas:~#ls -a
.   .cshrc      .history    .ssh
..  .dialogrc   .profile
My path is not there, but I have a .ssh (file or directory? I don't know)
I try
Code:
freenas:~#cd .ssh
freenas:~/.ssh# ls -a
. ..
This directory seems empty?

So I am lost, it seems when I log in as root, I am not at the top of the file system. Then how can I get to that top? Or maybe there is something I misunderstand completely?

:) Gabier
 
There has been a long debate on which home should get the root account. Some systems put root home to / (the root of the filesystem), others to /root and as far as I know none puts root under the usual /home path.

In your case you are in /root, that means that to get to the real root of the filesystem you have to either do
Code:
cd ..
or
Code:
cd /
and then you are going to see all other folders. Now to recognize if a file is a file or a folder use the
Code:
ls -l
command and see if the first column has a 'd' (directory) or a dash (file) or any other letter (special files). See [cmd=]man ls[/cmd] for more info.

So to summarize, the root account has a root home that do not coincide with the root of the filesystem.
 
fluca1978 said:
In your case you are in /root, that means that to get to the real root of the filesystem you have to either do
Code:
cd ..
or
Code:
cd /

Thanks, fluca, very simple. In fact I had seen that I was in /root, but I did not understand that it was already one level under the root of the file system.

I have not yet the linux way of thinking ;)

Gabier
 
Thank you sirdice,

This thread is solved but I do not know how to write this in the title as I cannot edit my post.

:) Gabier
 
The introductory email explains this. You can edit posts after 10 posts and 10 days of membership.

In this case a moderator will probably do it for you.
 
Back
Top