1
How to Access a Windows shared folder from Linux using the command line
This article will describe step-by-step how to access a shared folder based on Windows from a Pyramid deployment that is based on Linux.
If you haven't done so already, you will need to create a shared folder in Windows.
- Right-click the folder you want to share and go to Properties.
Go to Sharing tab -> Advance Sharing:
Tick Share this folder and Ok:
- Click Share
- Add Everyone with Permission Level of Read/Write
How to Access a Windows shared folder from Linux using the command line
- If you don't have it already, you will need to install smbclient, which can be done with the following commands:
For Ubuntu\Debian: sudo apt-get install smbclient
For CentOS: sudo yum install samba-client
sudo yum install samba-common-tools
- If you are using a machine that is on a domain, you will need to change the configuration and add your domain by editing smb.conf:
sudo nano /etc/samba/smb.conf
And change:
-security = domain
-workgroup = WORKGROUP
- With smbclient installed, you can connect to your Windows share using the command:
sudo smbclient /PathOfTheSharedFolder -U domain/YourUser
- Enter your user password
- Once authenticated, you are placed at an smb: \> prompt.
- Here, you can use the ls or dir command to list files.
- Use the command get filename.ext to transfer a file named filename.ext from your Windows share to your Linux machine.
NOTE: If the file name contains spaces, make sure to enclose it in double quotes.
For example: get "My new file.txt".
Reply
Content aside
- 1 Likes
- 1 yr agoLast active
- 70011Views
- 1 Following
Related Articles