LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Accessing samba shares from command line (https://www.linuxquestions.org/questions/linux-software-2/accessing-samba-shares-from-command-line-137729/)

paul.nel 01-23-2004 04:57 AM

Accessing samba shares from command line
 
Stupid question, how do I access samba shares from the command line?

Tx
p.n

drws 01-23-2004 05:13 AM

if you've shared a folder on your XP machine as \\xpmachine\share you can mount it with
mount -t smbfs -o username=???,password=??? //xpmachine/share /somewhere/to/mount
or leave the ,password= bit out to be prompted for a password.
or use smbclient (use with --help to see options)

paul.nel 01-23-2004 08:36 AM

Is this the only way to access them from the command line? All my shares are already mounted and that is not a problem, I can obviously get to the mounted shares. My question really is if there is a quick and dirty way to access the other machines if I have drives that are not mounted? Eg $ //sharecomputer/sharedrive or whatever.

Tx
p.n

sio 01-23-2004 10:39 AM

again, smbclient is what you want to use from the terminal.

Here it is in example for you:

smbclient //netbiosnameoripaddress/sharename -U anyusername

or if the share has spaces in the name you'll need to enclose in double quotes

smbclient "//netbiosnameoripaddress/share name" -U anyusername

if the share is public you shouldn't need to add the '-U anyusername' option. Although it will always prompt you for a password. If there is no password, leave it blank and hit enter. Thisll kick you into the smb prompt. Type help at the prompt

smb: \> help

for a list of commands. You should be able to manage it from there. Hope that helps.

paul.nel 01-24-2004 08:02 AM

Yip, sorted thanks.
p.n


All times are GMT -5. The time now is 08:12 PM.