About Me

My photo
Hi Friends, I am Sandeep CC and some people know me as System Administrator. I have started my professional career from 2008. I have been working as System Administrator on Linux Server and Windows Client. I am here to share my Knowledge in which I have experienced and which I have come across till now, It could be help to you people. In case anything wrong or any improvements in my post steps, Please comment to the post, Feel free to contact me by posting comments on this blog. Thanks and Regards, Sandeep CC

Monday, September 19, 2011

How To Access Windows Shared File/Folders In REDHAT LINUX Machine





How To Access Windows Shared File/Folders In Linux Machine

Note: For Accessing Windows Server 1st we have to configure Samba & Need to Start Samba Service, so 1st try to configure samba.

THIS IS OPTIONAL, IF WE USE SMBCLIENT THEN THIS STEP IS REQUIRED
(For Configuring Samba Server click on bellow link
"http://ccsandeep.blogspot.com/2010/05/configure-samba-on-rhel4.html" )

IMP POINTS:

1. Linux Machine and Windows Shared Machine Should Be In Same Network.

2. Linux Server Name: sandeep-linux-server & IP: 172.16.4.81
Windows Shared Name: sandeep & IP: 172.16.4.82 (User Name: sandeep & Password: sandeep123)

3. Share one folder in Windows Machine (Shared Folder Name = "shared-fodler")

4. Try To Ping Windows Machine from Linux Machine.
EXP: [root@sandeep-linux-server ~]# ping 172.16.4.82
PING 172.16.4.82 (172.16.4.82) 56(84) bytes of data.
64 bytes from 172.16.4.82: icmp_seq=1 ttl=128 time=0.726 ms
64 bytes from 172.16.4.82: icmp_seq=2 ttl=128 time=0.612 ms
64 bytes from 172.16.4.82: icmp_seq=3 ttl=128 time=0.469 ms
64 bytes from 172.16.4.82: icmp_seq=4 ttl=128 time=0.453 ms

--- 172.16.4.82 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 0.453/0.565/0.726/0.111 ms
[root@sandeep-linux-server ~]#

5. Must Need To Know Windows Shared Machine Name, User Mame & Password.


Steps:

1. Create One Directory in Linux on /mnt directory(Here we are mounting windows file in this directory)

[root@sandeep-linux-server ~]# cd /mnt/
[root@sandeep-linux-server mnt]# mkdir Windows
[root@sandeep-linux-server mnt]# ll
total 104
drwxr-xr-x 2 root root 4096 Sep 19 18:07 Windows
[root@sandeep-linux-server mnt]#

2. Now Mount Windows Shared folder into Linux /mnt/Windows directory (here need to give username=myuser, password=mypassword & windows shared machine name with directory)

[root@sandeep-linux-server mnt]# mount -t ntfs -o username=sandeep,password=sandeep123 //172.16.4.82/shared-folder /mnt/Windows/
[root@sandeep-linux-server mnt]# ll
total 192
drwxrwxrwx 1 root root 98304 Sep 15 14:24 Windows
[root@sandeep-linux-server mnt]#

OR

[root@sandeep-linux-server mnt]# mount -o username=sandeep,password=sandeep123 //172.16.4.82/shared-folder /mnt/Windows/
[root@sandeep-linux-server mnt]# ll
total 192
drwxrwxrwx 1 root root 98304 Sep 15 14:24 Windows
[root@sandeep-linux-server mnt]#

3. Now Check windows shared folder has mounted in linux machine...

[root@sandeep-linux-server mnt]# cd Windows/
[root@sandeep-linux-server Windows]# ll
total 5125818
-rwxrwSrwt 1 root root 121955032 Feb 21 2011 195.62_notebook_winvista_win7_32bit_international_whql.exe
drwxrwxrwx 1 root root 0 Mar 5 2011 ABBYYFineReaderPro7
-rwxrwSrwt 1 root root 17409 Jul 3 2007 Abhi_Time.htm
drwxrwxrwx 1 root root 0 Jul 22 10:26 ACDSee 8

4. Now check Unmount with Mounted diretory (Here "Windows" directory showing Total 0 file's)

[root@sandeep-linux-server mnt]# umount //172.16.4.82/shared-folder /mnt/Windows/
[root@sandeep-linux-server mnt]# ll
total 104
drwxr-xr-x 2 root root 4096 Sep 19 18:07 Windows
[root@sandeep-linux-server mnt]#cd Windows/
[root@sandeep-linux-server Windows]# ll
total 0
[root@sandeep-linux-server Windows]#


Thanks & Regards,
Sandeep CC

No comments:

Post a Comment