Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I logged onto my server from a remote computer via SSH using its hostname The Samba server's IP is

I then used the ssh command to connect with the local FTP server ( ssh Got asked if I want to proceed as the fingerprint was not in the list of known hosts. Confirmed, and it got permanently added to the list of known hosts.

Whenever I connect to now, I end up on instead of If I use ssh, I end up in a main directory containing the files initiatorname.iscsi iscsid.conf nodes instead of what I expected in the root directory.

How do I get back to the root where I will find folders like /var/logs?

share|improve this question

When you connect via ssh you enter the remote machine in the home directory of the user you are using to connect /home/username (or /root if you are connecting as root, but this is not permited by default on ubuntu for security reasons).

If your ssh command sends you to the ftp server instead of the machine, you have a routing problem or a DNS problem.

Your router (or firewall, not sure how is your configuration) can be redirecting port 22 to ftp server or you DNS resolver (local /etc/hosts file or DNS server or Samba server if you are using it to resolve hostnames) is pointing to your ftp server IP for host

Look at the output of nslookup on your machine to verify if this is a DNS related problem.

Obs: not sure if you need that, but to go to the / directory (where you find /var/log) you need to issue cd / command. SSH connections will never leave you there by default.

edit after comment

Ye, from nslookup output, it is your name resolution (done on server that is sending you to the wrong server.

Look at your /etc/hosts files in both servers and correct if wrong:

On, you should have the line server

and on the ftp server, you should have: ftpservername

Check the names of the servers with hostname on each and correct with hostname correctname and edit the config file with nano /etc/hostname.

Not sure how is DNS resolved on your network but if you are using bind, you will need to correct its zones config files too.

share|improve this answer
Hi, thanks for your reply! Your hint with the cd / command helped me a lot. – manu Feb 9 '13 at 13:50
I just tried nslookup, and the result is: Server: Address: ` ` Name: Address: What does it tell me? I still end up on everytime I connect to And from the nslookup output it seems to be meant like this, doesn't it? – manu Feb 9 '13 at 13:51
yes, it is meant like this by a wrong dns resolution. I edited the answer. – laurent Feb 9 '13 at 14:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.