Sometimes you need to configure FTP server for transferring file. There are so many FTP client for Linux OS. here in this post, FTP client of CentOS/Red Hat is mainly discussed. So lets try these process.
Configuring Linux FTP server: Samba Server
[ece@localhost Desktop]$ su –
Password:
Last login: Wed May 11 22:45:08 EDT 2016 on pts/0
[root@localhost ~]# yum install samba samba-client cifs-utils -y
Loaded plugins: fastestmirror, langpacks
base                                                    | 3.6 kB    00:00
extras                                                  | 3.4 kB    00:00
updates                                                | 3.4 kB    00:00
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* extras: mirrors.nwsuaf.edu.cn
* updates: centos.ustc.edu.cn
Package samba-4.2.10-6.el7_2.x86_64 already installed and latest version
Package samba-client-4.2.10-6.el7_2.x86_64 already installed and latest version
Package cifs-utils-6.2-7.el7.x86_64 already installed and latest version
Nothing to do
[root@localhost ~]# rpm -qa | grep cifs-utils
cifs-utils-6.2-7.el7.x86_64
[root@localhost ~]# groupadd samba-users
[root@localhost ~]# mkdir -p /sambashare
[root@localhost ~]# echo welcome to samba share zone by whilenetworking.com > /sambashare/welcome
[root@localhost ~]# chgrp samba-users /sambashare
[root@localhost ~]# chmod 775 /sambashare
[root@localhost ~]# ls -ld /sambashare
drwxrwxr-x. 2 root samba-users 20 May 11 23:08 /sambashare
[root@localhost ~]# useradd -s /sbin/nologin -G samba-users user1
[root@localhost ~]# useradd -s /sbin/nologin -G samba-users user2
[root@localhost ~]# useradd -s /sbin/nologin dep
[root@localhost ~]# smbpasswd -a user1
New SMB password:
Retype new SMB password:
Added user user1.
[root@localhost ~]# smbpasswd -a user2
New SMB password:
Retype new SMB password:
Added user user2.
[root@localhost ~]# smbpasswd -a dep
New SMB password:
Retype new SMB password:
Added user dep.
[root@localhost ~]# vim /etc/samba/smb.conf
[root@localhost ~]# nano /etc/samba/smb.conf
[root@localhost ~]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section “[homes]”
Processing section “[printers]”
Processing section “[Project]”
set_variable_helper(yes ; user write access): value is not boolean!
Error loading services.
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl restart smb.service
.
[root@localhost ~]# systemctl enable smb.service
ln -s ‘/usr/lib/systemd/system/smb.service’ ‘/etc/systemd/system/multi-user.target.wants/smb.service’
[root@localhost ~]# systemctl restart smb.service
Job for smb.service failed. See ‘systemctl status smb.service’ and ‘journalctl -xn’ for details.
[root@localhost ~]# systemctl status smb.service
smb.service – Samba SMB Daemon
Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled)
[root@localhost ~]# systemctl restart nmb.service [root@localhost ~]# smbclient -L //192.1698.42.2+X -U user1
Enter user1’s password:
Connection to 192.1698.42.2+X
root@localhost ~]# smbclient -L //192.168.42.2+X -U user1
Enter user1’s password:
Connection to 192.168.42.2+X
[root@localhost ~]# mount -t cifs //192.168.42.129+X/project[root@localhost ~]# mount -t cifs //192.168.42.2+X/project
[root@localhost ~]# df -HT
Filesystem            Type    Size Used Avail Use% Mounted on
/dev/mapper/centos-root xfs      19G 4.4G  15G 24% /
devtmpfs              devtmpfs 543M    0 543M  0% /dev
tmpfs                  tmpfs    553M 492k 552M  1% /dev/shm
tmpfs                  tmpfs  553M 7.8M 545M  2% /run
tmpfs                  tmpfs    553M    0 553M  0% /sys/fs/cgroup
/dev/sda1              xfs      521M 130M 391M 25% /boot
/dev/sr0Â Â Â Â Â Â Â Â Â Â Â Â Â Â iso9660Â Â 4.4G 4.4GÂ Â Â Â 0 100% /run/media/ece/CentOS 7 x86_64
[root@localhost ~]# df -HT
Filesystem            Type    Size Used Avail Use% Mounted on
/dev/mapper/centos-root xfs      19G 4.4G  15G 24% /
devtmpfs              devtmpfs 543M    0 543M  0% /dev
tmpfs                  tmpfs    553M 492k 552M  1% /dev/shm
tmpfs                  tmpfs    553M 7.8M 545M  2% /run
tmpfs                  tmpfs    553M    0 553M  0% /sys/fs/cgroup
/dev/sda1              xfs      521M 130M 391M 25% /boot
/dev/sr0Â Â Â Â Â Â Â Â Â Â Â Â Â Â iso9660Â Â 4.4G 4.4GÂ Â Â 0 100% /run/media/ece/CentOS 7 x86_64
[root@localhost ~]# ls
anaconda-ks.cfg
[root@localhost ~]# cd /media[root@localhost media]# ls
[root@localhost media]# umount /media
Please note the following point:
[root@localhost media]# vim /etc/samba/smb.conf:set nu
89 workgroup = EXAMPLE-X ; MYHOME to EXAMPLE (BLOCK Letter)
90 server string = Samba Server X ; Server Name
92 netbios name = Fileserver ; remove comment “;”
95 hosts allow = 127. 172.25.11. ; netowrk ID with ‘.’
123 security = user
Note:
security = server or share ; no password required
security = user ; password required
# write down as following share
322 [project] ; share display name
323 comment = RW for samba-users and RO for rakib ; share comment
324 path = /sambashare ; share path
325 browseable = yes
326 writable = yes ; user write access
327 write list = @samba-users ; user print access
328 read only = yes ; access for everyone
329 read list = rakib
hosts allow =
: x (save and quit)
Now you can browse from the client part: ——————————
=> Change Work-Group from my computer
=> Change Computer Name
=> Reboot
You can also Browse from Windows PC:
=> Start menu => run => \\192.168.42.2+X (samba IP)
Linux Desktop (Client) to Linux ServerX Access:
[root@desktopX ~]# smbclient -L //192.168.42.2+X -U user1
: 123
* [-N|–no-pass] * [-L|–list HOST] * [-U] — user
Lets see few screen shots of some steps:
Leave a Reply