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 have Ubuntu (Lubuntu 12.04) installed on sd card which i use in mk802 mini pc. When i mount sd card on my PC (Ubuntu 12.04) there is no possibility to read/edit files related to ssh (e.g. etc/ssh_config or etc/sshd_config) but i can see it in ls output:

root@boss:/media/d5578c69-a3c3-43be-a24f-9e1daaf6eb62/etc# ls -lrta ssh*
total 168
-rw-r--r--   1 root root    302 Jan 10  2011 ssh_import_id
-rw-r--r--   1 root root   1669 Apr  2  2012 ssh_config
-rw-r--r--   1 root root 125749 Apr  2  2012 moduli
-rw-r--r--   1 root root    395 Jun 12  2012
-rw-------   1 root root   1679 Jun 12  2012 ssh_host_rsa_key
-rw-r--r--   1 root root    175 Jun 12  2012
-rw-------   1 root root    227 Jun 12  2012 ssh_host_ecdsa_key
-rw-r--r--   1 root root    603 Jun 12  2012
-rw-------   1 root root    672 Jun 12  2012 ssh_host_dsa_key
-rw-r--r--   1 root root   2498 Dec  8 01:17 sshd_config
drwxr-xr-x   2 root root   4096 Dec  8 01:17 .
drwxr-xr-x 120 root root   4096 Jan 19 08:32 ..

root@boss:/media/d5578c69-a3c3-43be-a24f-9e1daaf6eb62/etc# cat sshd_config
cat: sshd_config: No such file or directory

Other files in the same folder have no such problem. What can be the reason of such behavior?

share|improve this question
try gedit sshd_config. – Avinash Raj Jan 19 '14 at 8:54
there is nothing in files when i open it using gedit. – user947668 Jan 19 '14 at 9:05
@falconer, no i can't – user947668 Jan 19 '14 at 9:10
up vote 1 down vote accepted

I see the problem. You use ls -lrta ssh* in the /etc/ directory. That matches the ssh directory in that folder and then lists the contents of that directory. Those files what you see are actually in /etc/ssh/.

An ls -lrtad ssh* will not go down into the directory.

Access your files from the /etc/ssh/ directory.

The tricky thing here is that ls normally would put a header in such cases that those files are from which directory when you try an ls with a * on the command line. The problem is that the * is expanded by the shell to make the command line. E.g when you write ls py* and the directory have a python and python3 entry too, the shell will actually run this command: ls python python3 and the output will be something like:



Because ls sees the multiple arguments it prints a header for each directory. So you can easily see that those files are from a different directories. But when there is only one match in the directory, like in your case, ls ssh* expands to ls ssh, then ls sees that you only put in one argument, so there is no need for the header, as you know what you are doing, and the output will be similar to yours.

share|improve this answer
indeed!!! i'm idiot :) thank you very much! – user947668 Jan 19 '14 at 9:27

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.