Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create symbolic links on server without SSH available?

Tags:

ssh

symlink

ftp

I got excited when I saw the following post but it doesn't cover my case: Mount an FTP server locally

Is there any way for me to create symbolic links on a remote server without having SSH access, possibly via some FTP hack?

like image 677
nero Avatar asked Apr 08 '11 01:04

nero


People also ask

How can a user create symbolic links?

A symlink (symbolic) is a type of file that points to other files or directories (folders) in Linux. You can create a symlink (symbolic) by using the ln command in the command line. Symbolic links are useful because they act as shortcuts to a file or directory.

Can symbolic links point to files that don't exist?

A symbolic link points to a file. In case, the original file is deleted, the symbolic link would be pointing to non-existing file. You can create a symbolic link to a directory too.

How do I create a soft symbolic link?

Use the -s option to create a soft (symbolic) link. The -f option will force the command to overwrite a file that already exists. Source is the file or directory being linked to. Destination is the location to save the link – if this is left blank, the symlink is stored in the current working directory.


2 Answers

Use a script.

If you have sh, bash or csh available, then you're nearly as good as if you had an ssh access. If you don't, then most other scripting languages allow you to create symbolic links on your server.

For example, in PHP you would use the symlink() function:

 symlink("myOriginalFileOrDirectory", "mySymbolicLink");  

I just had the same problem, and this is how I easily solved it :)

like image 118
KPM Avatar answered Sep 18 '22 11:09

KPM


Regular FTP is too abstract to know about symbolic links.

If the server supports custom commands, it might let you send the unix shell commands directly. Not all servers support this but some of them do.

If you have SFTP access (sometimes admins give users SFTP access but no SSH shell), SFTP protocol supports creation of symbolic links.

like image 31
Eugene Mayevski 'Callback Avatar answered Sep 16 '22 11:09

Eugene Mayevski 'Callback