LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Using SMB to copy files from one linux machine to second linux machine. (https://www.linuxquestions.org/questions/linux-networking-3/using-smb-to-copy-files-from-one-linux-machine-to-second-linux-machine-67587/)

coppersky 06-23-2003 08:50 PM

Using SMB to copy files from one linux machine to second linux machine.
 
This is a newbie question from somebody who has just added a second linux machine to his network.

This is the situation. I have a tiny home network -- 4 machines. I have two windows machines and two linux machines. I have samba up and running on one linux machine. I can access my samba server from my redhat machine using smbclient. I want to copy a file from my samba server to my redhat machine. How?

Thanks.

Sorry, you just use the get command. Very interesting.

delic 06-23-2003 09:03 PM

well you can use samba but i personally found a sweet little command a while ago.. scp (secure copy) You can copy a file from one machine to another with a simple command like this

scp copiedfile remotecomputerip_or_hostname:/path/for/file

so if you want to copy /etc/hosts.allow from one computer to the /home/user directory on the host linuxbox2

scp /etc/hosts.allow linuxbox2:/home/user

it's real handy... You may or may not be interested??

zmedico 06-23-2003 09:30 PM

Quote:

get <remote file name> [local file name]
Code:

man smbclient

coppersky 06-23-2003 09:34 PM

Thanks guys. I appreciate the replies.

I will try the secure copy "scp" command later.

I was a little confused because I was reading a howto someplace and they said to use the cp command. Obviously, it doesn't work.

I have a bad habit of anwering my own questions. Sorry. :study:

zmedico 06-23-2003 10:15 PM

You can also mount samba shares like nfs shares.
Code:

man smbmount

coppersky 06-24-2003 07:16 AM

Thanks. Mounting requires you to sign on as root, and the syntax seems a little clunky.

Using smbclient is almost like using FTP.

Thanks again.

zmedico 06-24-2003 11:07 AM

Whichever you prefer, but a user can mount an smbfs on a directory that they own. All you have to do is "chmod u+s /usr/bin/smbmnt" (as root). An entry in /etc/fstab can make the syntax more manageable.

coppersky 06-24-2003 11:11 AM

Thanks, I am learning. I appreciate your comments.

v3rb0 06-24-2003 11:26 AM

Quote:

Originally posted by coppersky
Thanks. Mounting requires you to sign on as root, and the syntax seems a little clunky.
.

You can put mount command in init script (e.g. /etc/init.d/local.sh) and then it will mount automacicaly.

mount -t smbfs -o username=user,password=user_password //remote/share /local/mountpoint
and all, nothing clunky :)

zmedico 06-24-2003 12:07 PM

Or you can mount it with all the other filesystems in /etc/fstab


All times are GMT -5. The time now is 11:42 AM.