I have a webserver which I log into over SSH. Recently, and I don't know what changed to cause this, any directory or symlink named "system" became invisible.
After SSHing into the server on the command line (Ubuntu terminal):
$ mkdir test_directory
$ cd test_directory/
$ ll
total 8
drwxr-xr-x 2 root root 4096 Nov 7 18:02 ./
drwxr-xr-x 4 root root 4096 Nov 7 18:02 ../
$ ln -s /var/www/repos/radiocms/admin/
$ ln -s /var/www/repos/radiocms/application/
$ ln -s /var/www/repos/radiocms/public/
$ ln -s /var/www/repos/radiocms/system/
$ ll
total 8
drwxr-xr-x 2 root root 4096 Nov 7 18:02 ./
drwxr-xr-x 4 root root 4096 Nov 7 18:02 ../
lrwxrwxrwx 1 root root 37 Nov 7 18:02 admin -> /var/www/repos/radiocms/admin//
lrwxrwxrwx 1 root root 43 Nov 7 18:02 application -> /var/www/repos/radiocms/application//
lrwxrwxrwx 1 root root 38 Nov 7 18:02 public -> /var/www/repos/radiocms/public//
$ cd /var/www/repos/radiocms/
$ ll
total 36
drwxr-sr-x 7 root apache 4096 Nov 7 16:49 ./
drwxr-sr-x 9 root apache 4096 Nov 7 16:49 ../
drwxr-sr-x 8 root apache 4096 Nov 7 16:49 .git/
-rw-r--r-- 1 root apache 9 Nov 7 16:49 .gitignore
-rwxr-xr-x 1 root apache 336 Nov 7 16:49 .htaccess*
drwxr-sr-x 7 root apache 4096 Nov 7 16:49 admin/
drwxr-sr-x 10 root apache 4096 Nov 7 16:49 application/
-rwxr-xr-x 1 root apache 1363 Nov 7 16:49 index.php*
drwxr-sr-x 5 root apache 4096 Nov 7 16:49 public/
$ cat /etc/*-release
CentOS release 6.4 (Final)
CentOS release 6.4 (Final)
CentOS release 6.4 (Final)
$ type ll
ll is aliased to `ls -alF --color=auto'
$ type ls
ls is aliased to `ls --color=auto'
$ which ls
alias ls='ls --color=auto'
/bin/ls
$ which ll
alias ll='ls -alF --color=auto'
/bin/ls
$ /bin/ls -al /var/www/repos/radiocms/
total 36
drwxr-sr-x 7 root apache 4096 Nov 7 16:49 .
drwxr-sr-x 9 root apache 4096 Nov 7 16:49 ..
drwxr-sr-x 8 root apache 4096 Nov 7 16:49 .git
-rw-r--r-- 1 root apache 9 Nov 7 16:49 .gitignore
-rwxr-xr-x 1 root apache 336 Nov 7 16:49 .htaccess
drwxr-sr-x 7 root apache 4096 Nov 7 16:49 admin
drwxr-sr-x 10 root apache 4096 Nov 7 16:49 application
-rwxr-xr-x 1 root apache 1363 Nov 7 16:49 index.php
drwxr-sr-x 5 root apache 4096 Nov 7 16:49 public
I know the symlink called “system” exists in the test directory: I just created it. I know the directory “system” exists in the “radiocms” directory, because the command line autocompleted for me when I was creating the symlink.
If I log in using Nautilus bookmarks (which uses SFTP), these directories show up just fine, but anything called “system” (folder, symlink to folder, or file) is invisible on the command line. What on Earth could be causing this? And how do I fix it?
If I then cd back to the test_directory, I get this:
$ ll
total 8
drwxr-xr-x 2 root root 4096 Nov 7 18:02 ./
drwxr-xr-x 4 root root 4096 Nov 7 18:02 ../
lrwxrwxrwx 1 root root 37 Nov 7 18:02 admin -> /var/www/repos/radiocms/admin//
lrwxrwxrwx 1 root root 43 Nov 7 18:02 application -> /var/www/repos/radiocms/application//
lrwxrwxrwx 1 root root 38 Nov 7 18:02 public -> /var/www/repos/radiocms/public//
$ find . -maxdepth 1 -type l
./public
./application
./system
./admin
So find
sees the symlinks, even if ls
doesn't. I'm confused.
ln
(ln -s /path/to/source /path/to/target
). Also check the return code ofln
to see if it's encountering an error./var/www
. Haven't tried a different shell. It's perfectly possible that the system is in some way compromised. @Doon.