Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 ssh_host_rsa_key.pub
-rw-------   1 root root   1679 Jun 12  2012 ssh_host_rsa_key
-rw-r--r--   1 root root    175 Jun 12  2012 ssh_host_ecdsa_key.pub
-rw-------   1 root root    227 Jun 12  2012 ssh_host_ecdsa_key
-rw-r--r--   1 root root    603 Jun 12  2012 ssh_host_dsa_key.pub
-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 at 8:54
    
there is nothing in files when i open it using gedit. –  user947668 Jan 19 at 9:05
    
@falconer, no i can't –  user947668 Jan 19 at 9:10

1 Answer 1

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:

python:
debian_config

python3:
debian_config

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 at 9:27

Your Answer

 
discard

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.