Access remote share from Linux terminal

3 08 2013

Here are some smart commands in order to access remote shares (Samba or Windows) from Linux command line.

1) using smbclient:
smbclient -U myuser //server/share

2) mounting the share:
mkdir /mnt/folder
mount -t smbfs -o username=myuser //server/share /mnt/folder

3) using smbmount:
apt-get install smbfs
mkdir /mnt/folder
smbmount //server/share /mnt/folder -o user=myuser

You’ll then be prompted for myuser password.

If you want to map the remote share on startup, edit:
nano /etc/fstab

then append (single line):
//server/share /mnt/folder smbfs
auto,gid=users,fmask=0664,dmask=0775,iocharset=iso8859-15, credentials=/etc/mycredentials 0 0

Be sure to create /etc/mycredentials file and write:
username = myuser
password = mypassword




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: