目錄表
Connecting to your instance via command line with 'sshfs'
For practical reasons, you may wish to use the command line to manage your files with common commands (ls
, cp
, mv
, ln
…) and using utilities like grep
and sed
.
In addition to being able to access your Simple Hosting instance via ssh, you can also manage your files via command line with sshfs
. This will allow you to mount the remote directory of a Simple Hosting instance on your local machine.
sshfs
can usually be installed using your preferred package manager.
sshfs
utility uses 'FUSE', a framework initially intended for POC (Proof of Concept). This tool can sometimes be unstable. For more information on FUSE, see http://fuse.sourceforge.net/.
Create a directory for mounting
To begin, we will create the directory to mount:
alx@desktop:~$ mkdir SimpleHosting
Connect to the remote directory
Once the directory is created, connect to the remote directory using sshfs
.
In a terminal window, type:
alx@desktop:~$ sshfs login@sftp.dc0.gpaas.net:/ SimpleHosting/
login
: This is the 6-digit number you use to connect to your instance;sftp.dc0.gpaas.net
: Replace this with the address of the remote server;:/
: the destination directory to mount. In this case, we want to mount the root to have full access to all directories;SimpleHosting
: The mount point. The path can be either relative or absolute.
You will then be asked to enter the SFTP password.
Once connected, simply navigate to the mounted directory. You can now use the command line as usual.
alx@desktop:~$ cd SimpleHosting/ alx@desktop:~/SimpleHosting$ ls -l total 32 drwxr-xr-x 1 root root 8 2011-10-14 17:50 ./ drwxr-xr-x 38 alx alx 4096 2012-03-25 16:15 ../ drwxrwxr-x 1 root 5100 7 2012-03-13 14:45 lamp0/ drwx------ 1 5000 5000 2 2011-09-13 17:03 private/ -rw-r--r-- 1 root root 1064 2011-10-14 17:50 README.txt lrwxrwxrwx 1 root root 13 2011-10-14 17:50 snapshot -> .zfs/snapshot/ drwx------ 1 5000 5000 3 2012-03-12 22:39 .ssh/ lrwxrwxrwx 1 root root 16 2011-10-14 17:50 vhosts -> lamp0/web/vhosts/