Use ' Level two 'samb for file access.
Pc-----------Samba----------->218.205.81.12----------samba---------->10.3.1.193 (SRC, compilation environment )
1.Install Samba on the compilation host (10.3.1.193)
Log in to the build host with root role
SSH [email protected]
1) Install samb
Service iptables stop// shutdown firewall:
Setenforce 0// disable SELINUX Mandatory mode
Yum Install Samba samba-client Samba-swat// installation samb
Cd/etc/samba
2) Configure shared Paths
Cp smb.conf Smb.conf.bak// backup
Vi/etc/samba/smb.conf
Use shift+g to navigate to the last line:
# A publicly accessible directory, but read only, except for people in
# the "Staff" group
[Public]
Comment = Public Stuff
Path =/home/samba
writable = yes
printable = no
Write list = +staff
Modify the following
# A publicly accessible directory, but read only, except for people in
# the "Staff" group
[Public]
Comment = Public Stuff
Path =/HOME/RCSM
Available = yes
browseable = yes
Public = yes
writable = yes
printable = no
Write list = +staff
Note that /HOME/RCSM is the directory to be shared with the springboard machine.
:Wq// Save Exit
3) Add samb user name and password
Sampasswd-a root// add user name, must be one of the Linux user names
Root// password, not the same as the linux login password
4) Restart samb
/ETC/INIT.D/SMB Restart// restart samb
/ETC/INIT.D/NMB Restart// restart nmb
Chmod 777/HOME/RCSM
All right , the samba on the 10.3.1.193 is installed.
2.Install Samba on the springboard machine (218.205.81.12)
Process Ibid.
The only difference is that thepath sets a different value inthe vi/etc/samba/smb.conf (which you decide)
# A publicly accessible directory, but read only, except for people in
# the "Staff" group
[Public]
Comment = Public Stuff
Path =/MNT/SMBCLNT
Available = yes
browseable = yes
Public = yes
writable = yes
printable = no
Write list = +staff
The Samba on both machines was installed and started.
chmod 777/mnt/smbclnt
3. Test Samba
PC -side access to the/MNT/SMBCLNT on the springboard machine :
In the lower left-hand corner of the screen, enter:
\\218.205.81.12
Enter the user name and password after entering, do you remember what we added for samba ?
The user name and password are root
Enter after we can see the Public directory, open, is The content of /MNT/SMBCLNT
The springboard machine accesses the/HOME/RCSM on the compiled host :
View shared directory Name:
Smbclient-l 10.3.1.193-u root%root//root,root is The user and password we set for Samba
Sharename Type Comment
--------- ---- -------
Public Disk Public Stuff
ipc$ IPC IPC Service (Samba Server Version 3.6.23-20.el6)
Root Disk Home Directories
Public is 10.3.1.193share out of the shared directory, that is, /home/rcsm
At this point, two samba are OK.
4. Connection of two samba
Now the PC also has access to the shared directory of the springboard machine, and cannot access the compiled host directly. Connect two Sambaand let the pc directly access the compiled host!
Samba Samba
Pc-----------------------> springboard -------------------------> Compile host
Connect two Samba with Mount
On the Springboard machine:
Mount-t cifs//10.3.1.193/public/mnt/smbclnt/-o username=root%root
To view the mount results:
Df
10.3.1.193/public 56214868 6665020 46687616 13%/mnt/smbclnt
In order to restart auto Mount, configure the fstab file
Vi/etc/fstab
Add at the end:
10.3.1.193/public/mnt/smbclnt CIFS defaults,username=root%root 0 0
: Wq// Save exit
That is, a samba client as the serverfor another samba.
Pc-----------------------> springboard -------------------------> Compile host
Samba Client Samba Server/client Samba server
Now that everything is ready, in the pc -side Command box, enter
\\218.205.81.12
To access the /HOME/RCSM on the compiled host
Note that the user name password is root
5 Map Network drive, implement code modification, compile, upload large unified
Go to My Computer and click on the mapped network drive to map the local Z: Disk into
\\218.205.81.12\public
From then on you can access 10.3.1.193/HOME/RCSM directly from Z: Disk .
Z: As a local directory of Sourcetree, you can put the code down to 10.3.1.193, to implement local modification local compilation local upload!
Cross-network segment samba access