LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   folder sharing problem for newbie (https://www.linuxquestions.org/questions/linux-newbie-8/folder-sharing-problem-for-newbie-4175648326/)

DagJNJ 02-14-2019 05:31 PM

folder sharing problem for newbie
 
Hello there,
nice to be here. I am new to this forum.
I read the rules, and hope I do it right.
I searched for folder sharing problems, but i didn't get an answer which could help.

I'm not new to Linux, but I am to networking.
I did something with Samba before, but that was in the stone-age with Windows.
Now we use only Linux. Since my wife also has a PC now, we want to share some files. My PC I call CD01 and my wifes CD05, there are some laptops with CD02, CD03 and CD04 for stand-alone use.
We use Mate 16.04.5, always kept up to date, on no-name PCs, CD01 is a new AMD, pretty fast, and CD05 is an I3, slower. The boards are technology of the day.
I have installed samba, samba-common and system-config-samba (last one for the GUI).
Server-Options:
Workgroup villa26
Description %h server (Samba, Ubuntu)
Autentification-mode User
Encrypt password Yes
Guest-account no
Samba User:
My name dag
Wifes name claudia

Both user are also made in user management of Ubuntu, as desktop users.
Hope this is enough information.

We can ping each other, but when I try with Samba(system-config-samba), CD05 see CD01, it last a long time, then I see the folder on CD01, click to connect, takes long again, then comes the login window.
I enter the data, claudia and pwd. Takes long again, then only the login window appears again.
That is somehow frustrating, as I thought networking would be easy with Linux.

I hope for some help, and many thanks in advance .
Regards,
Newbie Dag

michaelk 02-15-2019 10:52 AM

Since you only use linux why bother with samba.

You can easily use sftp which is available from the file browser. I assume you have usernames on both PCs. Have a directory with the appropriate permissions for both users. You can use keys with a bookmark in the browser to quickly access the shared directory.

You can also use nfs with the shared directory and use autofs or xsystemd automount to automatically mount the directory. Because the share is only mounted when accessed it not an issue when the computer is not on the LAN.

frankbell 02-15-2019 08:32 PM

Did you enter Samba user names and passwords?

See man smbpasswd for more.

DagJNJ 02-16-2019 08:50 AM

Quote:

Originally Posted by michaelk (Post 5962478)
Since you only use linux why bother with samba.

Thank you very much, I hoped for something like that. (Hate to see "Windows-Network" on my computer anyway)
I will try that and come back.

DagJNJ 02-18-2019 08:13 AM

@michaelk

Quote:

Originally Posted by DagJNJ (Post 5962843)
I will try that and come back.

I seem not to understand everything (or not at all)
I tried to find out about sftp and NFS but it's over my horizon.
First sftp:
Do I have to install?
Does it work with caja, used by Mate 16.04.5?
One perhaps silly problem: How do I assign more usernames to one folder?
Only way I think of is to use a group in which user are in.

Second NFS:
I'm a little confused about the use of server in the tutorials.
I have two desktops, not one dedicated server-
Do I have to install the nfs-server on both?

(I am aware of that these are to different cases)


Regards,
Dag

DagJNJ 02-18-2019 08:30 AM

Quote:

Originally Posted by frankbell (Post 5962663)
Did you enter Samba user names and passwords?

See man smbpasswd for more.

Hi, don't want to ignore you.
yes I have set names and password in both system user and samba user.
I always get the login screen every time and time again, also tried guest allaowed.

Regards,
Dag

michaelk 02-18-2019 08:44 AM

linux is a multi user system and I was asking if you added yourself as a user on your wife's computer and vice versa. Otherwise you can share username/passwords...

A server is the computer that provides the functionality regardless if it just running a desktop distribution and the client connects to the server. Each computer needs either ssh or nfs server running depending on how you want to connect to each other and share files.

ssh is a secure network protocol to login to a remote server which sftp is a subsystem for transferring files between the client and server. ssh is usually installed by default but you might need to configure it to automatically start and maybe configure the firewall if running to allow ssh connections.

caja has a tool "Connect to Server" where you can access a server using several protocols i.e. ftp, ssh, samba etc. Selecting ssh would connect to the other computer using ssh/sftp protocol. You specify the hostname/IP address, username, password and the directory that will be displayed in the file browser.

A nfs share would be configured in your /etc/fstab and as suggested using an autofs/xsystemd automount would be recommended since the share is only mounted when accessed by the client and automatically disconnected after an idle time out.

DagJNJ 02-18-2019 10:04 AM

@michaelk
Quote:

Originally Posted by michaelk (Post 5963577)
linux is a multi user system and I was asking if you added yourself as a user on your wife's computer and vice versa. Otherwise you can share username/passwords...
.

I installed ssh-server (ssh-client was already present)
I looked up in a tuutorial how to configure, only two parameters (Port 2222 instead of 22 and the Banner I just confirmed)
I opened all traffic for "at home" in the firewall.
User and password I checked.
Still, I can't connect.
I called the wife's PC CD05, and trying to connect to the server says no cd05 found.
Also, if I try to ping cd05, after a while it says no cd05 found.
It seems to me, I lack something here.
I tried connection with SSH, FTP with authentification and FTP alone.

michaelk 02-18-2019 10:13 AM

You need to use the IP address. Typically SoHo routers do not provide local LAN DNS services.

Did you restart the server after you changed the sshd_config file?

Make sure you can connect using the command line ssh client

ssh -p 2222 username@IP_address

DagJNJ 02-18-2019 10:27 AM

Quote:

Originally Posted by michaelk (Post 5963596)
You need to use the IP address.

That worked, at least I see the files and folders. A big improvement indeed!
I just have to check the permissions, can't change anything on the remote PC yet, that I will find out.

One thing makes me think - I use a router providing me with the IP-addresses (DHCP) in the LAN.
I'm not sure what happens after a system restart.

A big THANK YOU helping me so far.
Regards,
Dag

michaelk 02-18-2019 11:00 AM

There are a few ways.

It depends on how the router implements the DHCP server and typically the same IP address will be used if possible. You should be able to configure a DHCP reservation in the router to assign a specific IP address to a device then add a line in the /etc/hosts file so that it will resolve hostname to IP address. If you go the ssh route you can create a /home/username/.ssh/config file that basically does the same thing.

DagJNJ 02-18-2019 11:11 AM

Quote:

Originally Posted by michaelk (Post 5963622)
There are a few ways.
If you go the ssh route you can create a /home/username/.ssh/config file that basically does the same thing.

I first try with some restarts. I think it gives me the same IP every time.
What I can't, is to copy a file from CD01 to CD05, or make a file. It tells me "wrong answer". (Translated from German)

michaelk 02-18-2019 11:17 AM

Did you connect using caja or just ssh from the command line? If just ssh using the command then it is just for remote access not file sharing. If you connected using caja then make sure your in a directory that you have read permissions. Copying files is just copying/pasting from one directory to another.

DagJNJ 02-18-2019 12:17 PM

Quote:

Originally Posted by michaelk (Post 5963631)
Did you connect using caja or just ssh from the command line? If just ssh using the command then it is just for remote access not file sharing. If you connected using caja then make sure your in a directory that you have read permissions. Copying files is just copying/pasting from one directory to another.

I connected through caja. I just want to get files from the other. CD02<->CD05. Copying works. I can't make folder or files on the remote PC, but can live with that, just a mater of organisation.
What can I do with remote access?

michaelk 02-18-2019 02:44 PM

If you used /home/username as the folder name when you connected to the server you should have write as well as read permissions. By default a regular user has read but limited write permissions outside their home directory.

You can do just about anything as if you were physically at the computer itself even a remote desktop.


All times are GMT -5. The time now is 04:58 AM.