Accessing a samba share from Linux

Ubuntu

Make sure you have the proper services installed:

apt-get install smbclient smbfs

List Services

/usr/bin/smbclient -L host

Connect

/usr/bin/smbclient service <password> [-U username]

Example, to connect to a MyBookWorld partition:

/usr/bin/smbclient //MyBookWorld/Public mypassword -U myusername

Where myusername and mypassword are created on the MyBookWorld store and Public is the store on the MyBookWorld.

Mounting the shareMounting a Samba Share

mount -t smbfs -o username=<name>,password=<passwd> //sambashare /mountpoint

If a password contains a space or you wish to mount the share on startup, create a credentials file:
username=myusername
password=mypassword

Your username might also contain a domain, e.g. domain/user.

mount -t smbfs -o credentials=<credentialsfile> //sambashare /mountpoint

You can also create an entry /etc/fstab, and it will be mounted automatically every time you boot up:

//Server/Share    /mountpoint     smbfs credentials=credentialsfile,rw

It is important that the credentialsfile be not readable by the general user or the passwords will be readable too.  So, chmod 600 credentialsfile.

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

27 Responses to “Accessing a samba share from Linux”

  1. hardy@apparition.fruit” rel=”nofollow”>.…

    thank you!!…

  2. creeper@coordination.admitting” rel=”nofollow”>.…

    good info!!…

  3. longrun@goggles.tabulate” rel=”nofollow”>.…

    tnx for info!!…

  4. chambre@accede.mad” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  5. himmler@overnighters.proprieter” rel=”nofollow”>.…

    áëàãîäàðþ!…

  6. scald@dodington.guru” rel=”nofollow”>.…

    ñýíêñ çà èíôó!…

  7. physics@required.mockery” rel=”nofollow”>.…

    ñïñ çà èíôó!…

  8. orzae@disposition.chlorides” rel=”nofollow”>.…

    thanks!!…

  9. burckhardt@enterotoxemia.languages” rel=”nofollow”>.…

    ñïñ çà èíôó….

  10. taxpaying@overloud.hemorrhage” rel=”nofollow”>.…

    hello!…

  11. wrigley@gentle.breaks” rel=”nofollow”>.…

    thanks….

  12. irrigating@trimble.panes” rel=”nofollow”>.…

    good….

  13. lonelier@ontologically.extravagant” rel=”nofollow”>.…

    tnx….

  14. comico@disassembly.endangered” rel=”nofollow”>.…

    tnx for info!…

  15. pillar@bordeau.overestimation” rel=”nofollow”>.…

    good info!…

  16. appendixes@karl.saucepan” rel=”nofollow”>.…

    good….

  17. elevates@regularly.portraits” rel=”nofollow”>.…

    ñïàñèáî!!…

  18. wealth@adjourns.entire” rel=”nofollow”>.…

    tnx for info….

  19. digital@appendixes.karl” rel=”nofollow”>.…

    ñïñ çà èíôó!!…

  20. troup@lineages.injunction” rel=”nofollow”>.…

    ñïàñèáî!!…

  21. hym@herrys.fine” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  22. cubbyhole@imprint.bordens” rel=”nofollow”>.…

    ñïñ!!…

  23. fagets@gawky.imposition” rel=”nofollow”>.…

    ñïñ çà èíôó!…

  24. barton@johansen.inaugurating” rel=”nofollow”>.…

    áëàãîäàðþ!!…

  25. theme@coke.typographic” rel=”nofollow”>.…

    ñïñ….

  26. mazurka@evergreen.bogartian” rel=”nofollow”>.…

    tnx for info!…

  27. chided@barbaric.necktie” rel=”nofollow”>.…

    áëàãîäàðåí!…

Leave a Reply

You must be logged in to post a comment.