0

Basically I got two ubuntu machines on network. One is at ip 10.0.0.6 and other at 10.0.0.1

Two copy the files I have to use scp source/file/path user@destination-ip and another problem of using scp is that I have to add ssh key to destination authorized keys.

This seems to be too complicated and I would like an easier method where I can just do

cp file/path some/other/path

To achieve this some/other/path should be a symbolic link from what I know.

I also don't have any problem if the destination-ip can be mounted on a path so that I can simply do

cp file/path 10.0.0.6/some/path

Basically I want to access the shared directory normally with normal cp or any normal command which can be used on local directories too, like ls,etc. And I want this because I have a application running in one ubuntu machine which creates log, and I have another application in another server which creates log, but I want the log to be created in one server only. In that application I have to give the log path, so I can give only a normal file path.

Just like windows you can share a folder over the LAN.

Also I want a solution which uses command line only strictly, because I have seen solutions at askubuntu.com with UI but my machines are on network and I can only ssh to them using command line.

I found NFS Mount system which is what I am looking for.

When I install NFS i get error:

Unable to locate package nfs-utils

2 Answers2

2

As covered in comments; you have multiple options which are not mutually exclusive.

SaMBa - small|server message block; an old IBM protocol dictated to be used for IBM PC Lan Manager coded by microsoft (thus its still used today by windoze, with a new name CIFS (common internet file system)).

NFS - network file system. It's a unix/*nix file system, is faster & has many advantages over SaMBa but isn't available by default for windoze workstations without additional software.

You needn't restrict yourself to one (or in fact just these two!); ie. I use NFS for all real work (read/writes), but also allow read-only access to some folders via SAMBA so simple media players can access mp3's etc.

For clients (machines using the data) the package nfs-common is required, for the servers you'll need the package nfs-kernel-server; or both if boxes want to act in serving & client modes.

https://help.ubuntu.com/community/SettingUpNFSHowTo

guiverc
  • 33,561
-1

This appears to be the same question. Perhaps try the solution listed here. I have summarized it below for convenience.

Mount remote directory using SSH

Setup:

sudo apt-get install sshfs
sudo modprobe fuse
sudo adduser $USER fuse
sudo chown root:fuse /dev/fuse
sudo chmod +x /dev/fusermount
mkdir /desired/local/directory/path

Using:

sshfs dest-user@dest-ip:/desired/destination/directory/path /desired/local/directory/path