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

user1735921
  • 155
  • 2
  • 2
  • 13
  • 1
    windoze uses SaMBa (small or server message block with some A's added; an old IBM protocol), which is one option esp. if you want to share data with non-nix machines (ie. windoze). there are other options, eg. I use NFS (network file system) which allows me to mount machine:/directory-paths which works great esp. within nix machines (unix, gnu/linux, mac etc). when mounted you don't refer to machines, its 'cp path/dest path/dest' for both. both can be setup to automount via /etc/fstab; or by command. i wouldn't know how to do either via gui, but I'd need the vi(m) editor – guiverc Sep 29 '17 at 21:52
  • I want to use NFS using mount via Command Line or Vim is fine. I am trying to find a tutorial to it. Edit: I tried to install apt install nfs-utils nfs-utils-lib on ubuntu 16.04 its gives error Unable to locate package nfs-utils – user1735921 Sep 29 '17 at 22:05
  • 1
    i did a dpkg -l nfs* on this 16.04 box & see nfs-common, nfs-client & nfs-kernel-server. nfs-common is from memory what you need to mount NFS as local (the only one installed on this box anyway). the nfs-kernel-server obviously is needed for the box which will share or serve the files (headless boxes elsewhere). sorry I don't have more time now. – guiverc Sep 29 '17 at 22:49

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
  • 30,396
-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
  • Hi thanks for answer and suggestion. But I want to use nfs not ssh, as I have already mentioned in my question title and question also. – user1735921 Sep 29 '17 at 22:51