no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | tech:linux:mount_samba_windows_share [2015/01/02 12:56] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Mounting Windows Shares in Linux (Ubuntu) ====== | ||
+ | ===== List what fstab has for reference later ===== | ||
+ | < | ||
+ | # cat /etc/fstab | ||
+ | # /etc/fstab: static file system information. | ||
+ | # | ||
+ | # Use 'blkid -o value -s UUID' to print the universally unique identifier | ||
+ | # for a device; this may be used with UUID= as a more robust way to name | ||
+ | # devices that works even if disks are added and removed. See fstab(5). | ||
+ | # | ||
+ | # <file system> <mount point> | ||
+ | proc /proc | ||
+ | # / was on /dev/sda1 during installation | ||
+ | UUID=7709d75b-9467-40c8-8e39-1d0c52178e90 / | ||
+ | # /bak was on /dev/sdb1 during installation | ||
+ | UUID=c85d21a5-68c4-4ec4-9ce0-695d5e44bae8 /bak ext4 defaults | ||
+ | # swap was on /dev/sda5 during installation | ||
+ | UUID=4e564935-9c47-47ea-941e-08f5f73d2175 none swap sw 0 0 | ||
+ | </ | ||
+ | |||
+ | ===== Commands to mount ===== | ||
+ | Note | ||
+ | * hello_pc is the name of the Windows Machine | ||
+ | * Using the same name for the mount point name as well | ||
+ | * First do a ls -l / | ||
+ | * If you do and don't want to use it anymore do an " | ||
+ | |||
+ | <code bash> | ||
+ | aptitude install cifs-utils | ||
+ | mkdir -p / | ||
+ | mount -t cifs -o username=hello, | ||
+ | cd / | ||
+ | ls | ||
+ | </ | ||
+ | |||
+ | ===== Making the changes permanent (available on reboot) ===== | ||
+ | Add this to /etc/fstab | ||
+ | < | ||
+ | # Adding Windows Share - hello_pc | ||
+ | // | ||
+ | </ | ||
+ | |||
+ | Create the password file / | ||
+ | < | ||
+ | username=hello | ||
+ | password=mypassword | ||
+ | </ | ||
+ | |||
+ | Secure the sambapasswords file | ||
+ | < | ||
+ | # chown 0.0 / | ||
+ | # chmod 600 / | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Command line connection (not using established shares) ===== | ||
+ | |||
+ | Command to connect to windows share with samba client | ||
+ | < | ||
+ | smbclient // | ||
+ | </ | ||
+ | Output | ||
+ | < | ||
+ | Enter senthil' | ||
+ | Domain=[SENTHIL_LT] OS=[Windows 7 Home Premium 7601 Service Pack 1] Server=[Windows 7 Home Premium 6.1] | ||
+ | smb: \> | ||
+ | </ | ||
+ | |||
+ | ===== Listing Windows shares ===== | ||
+ | |||
+ | < | ||
+ | |||
+ | root@ub4:/ | ||
+ | Enter senthil' | ||
+ | Domain=[SENTHIL_LT] OS=[Windows 7 Home Premium 7601 Service Pack 1] Server=[Windows 7 Home Premium 6.1] | ||
+ | |||
+ | Sharename | ||
+ | --------- | ||
+ | ADMIN$ | ||
+ | C$ Disk Default share | ||
+ | IPC$ IPC | ||
+ | Users Disk | ||
+ | Domain=[SENTHIL_LT] OS=[Windows 7 Home Premium 7601 Service Pack 1] Server=[Windows 7 Home Premium 6.1] | ||
+ | |||
+ | Server | ||
+ | --------- | ||
+ | |||
+ | Workgroup | ||
+ | --------- | ||
+ | |||
+ | </ | ||