RSS

Tag Archives: Terminal

Installing Samba Server on Ubuntu – Breaking News

Disillusioned with the lack of progress so far, I went back and made sure I had done everything perfectly.

Turns out I hadn’t.

I’ve made the edit to my post – Part III – and realised the error of my ways.

I had made “browseable=yes” commented out in the config file.

This means that when my Mac was looking for it, it couldn’t find it because I was “browsing” for it and that isn’t allowed. So, since I took out the comment symbol, meaning that the browseable=yes was then actually a setting, I can now find the folder and added it to my Mac!!!

Very happy.

I still have to do a few things to get the Mac looking at a hard drive on the Ubuntu machine, but baby steps, right?

Also, I wanted to quickly elucidate on the ping thing.

On the Mac, I opened the Terminal window (Lauchpad – Other – Terminal, which looks like a grey box with a black background and a cursor on it) and typed in the following:

ping kbfileserver.local

At first it gave me weird messages about how it couldn’t find anything, but then I remembered I had turned off the wireless on the ubuntu machine. I turned it back on and tried again. It then started giving me messages about how many microseconds it took to return the ping. I got excited.

I found this in Wikipedia about “ping” and thought it was a good explanation:

Ping is a computer network administration utility used to test the reachability of a host on an Internet Protocol (IP) network and to measure the round-trip time for messages sent from the originating host to a destination computer. The name comes from active sonar terminology which sends a pulse of sound and listens for the echo to detect objects underwater.

So I guess, the good thing is to have a notification including the time given to you which would mean that the message has actually been there, connected and returned. If it doesn’t connect, and therefore can’t transmit the message, it will also tell you. This way it’s easy to tell if the other machine is at all visible.

Anyway, I now need to find out the rest of the information I need to set the hard drives up, but more on that tomorrow.

 

Advertisements
 
Leave a comment

Posted by on February 7, 2014 in Nerdy Computer Stuff

 

Tags: , , , , , , , , ,

Installing Samba Server on Ubuntu Part IV

The next step in trying to fix this is now back to the terminal window and trying to get this thing connecting.

From the ubuntu boards, Morbius1 has suggested:

  • [4] Then I want to create a “Samba” directory away from your home directory.
sudo mkdir -p /Samba/Public

I’ve just gone into my Terminal window (remember it’s Crtl-Alt-T) and typed this in.

Looking at the command, again we see the power word “sudo” and the command “mkdir” could possibly be MaKe DIRectory. The “-p” could be anything, but I’ve noticed that there are other ones too, like “-a”, but I don’t know what they mean. I’m assuming it’s some sort of formatting command. Lastly, the /Samba/Public must be the actual name of the directory (or folder) that’s being created here.

I sure hop it worked, because the Terminal just asked me for my sudo password and then spat me back to the cursor. I’m assuming no news is good news.

  • Then change permissions so that anyone can access it:
sudo chmod 777 /Samba/Public

This is typed in the terminal window. Power word sudo, as usual. The chmod 777 is tricky, but I’m think the mod is short for modification, so that kinda makes sense – the 777 I believe is the setting for the modification. I don’t know much about this, but I looked it up on Wikipedia and it seems I was wrong. Chmod is short for CHange MODe. And the numbers are about permissions. This is a little off track, but interesting…

# Permission rwx
7 full 111
6 read and write 110
5 read and execute 101
4 read only 100
3 write and execute 011
2 write only 010
1 execute only 001
0 none 000

I don’t know about this rwx thing, but the fact that each of the 7’s give full permissions, seems like a pretty solid thing to do. Hang I just worked it out. r = read, w = write and x = execute. Therefore, it seems that the 777 means that we’re setting full permissions to read, write and execute (execute = run or start up).

I put that into the terminal and it didn’t care. Again, assuming no news is good news.

  • [5] I want to create the simplest possible share at the bottom of smb.conf as the only share on this box:
[public]
path = /Samba/Public
guest ok = yes
read only = no
force user = keith

I’m getting a bit dizzy going back and forth between the Terminal and the pop-up conf edit window, but it seems necessary.

I’ve opened the conf window again using the command as I did in the last post:

sudo gedit /etc/samba/smb.conf

I didn’t want to just whack it in, so I did a little comment of my own and added the code as suggested above.

# This section added for troubleshooting connection
# 
[public]
path = /Samba/Public
guest ok = yes
read only = no
force user = keith

I then saved the conf file by pressing the save button in the menu bar of the pop up window. When I’m back in the Terminal, I’ll do the next step.

  • [6] Then restart some services:
sudo service smbd restart
sudo service nmbd restart

As you may recall, we went through all about these “daemon” things that are the little services that run all of the samba stuff in the background. We’ve made changes to the config and other things, so we should start these running again so any changes can be picked up. Sudo, power word. “Service smbd” or “Service nmbd” are the file names of the services and, I assume, the type (eg service). Restart is pretty straight forward.

After entering the above into the Terminal window and hitting enter after each line, I got the following responses:

smbd stop/waiting

smbd start/running, process 4040

 

nmbd stop/waiting

nmbd start/running, process 4054

That done, onto the last step as offered on the forum…

  • [6] Then we’ll see if the Linux box itself can access it’s own samba share with the following command in the terminal:
nautilus smb://kbfileserver.local/public

This is starting to look a little scary now, because I’m not quite sure if there are steps I should be doing. I’m writing this post as I’m doing the tutorial, so I hope I’m doing it right!

Alright, done. Some, I think, positive results. Firstly, there isn’t anything that happens when you type the above in – you end up at the cursor with no message. However, when I first did it, it gave me a pop up error message that said I couldn’t connect.

Then I remembered that I had turned the wireless off. I reconnected to the network and typed the line in again. This time there still wasn’t a message, but there was a whiring of the hard drive – it seemed that something was happening.

I noticed that the “files” tab on the desktop was highlighted as if I had opened a screen. I clicked on the icon and it happily looks like I am now connected to that folder through the network. This is kinda of cool. It really seems like we’re getting somewhere.

  • [7] If that works we can see if you can do the same thing from the mac using “guests” not “keith” as the “Connect As” user.

Just when I was doing so well. I don’t really know what this step means, and further, I don’t know how to do it. Bear with me while I try to battle my way through it.

I’ve gone to my Mac and clicked on the Finder program to bring it up. Then I’ve gone to the menu bar at the top and clicked on Go to get the drop down for “Connect to Server”. Currently I have two connections set up – neither work – as recommended earlier in my posts.

  • smb://keith@kbfileserver.local/keith
  • smb://kbfileserver.local/keith

The kbfileserver.local/keith seems to be very similar to the one I got nautilus to set up above. So I doubled clicked on it and it gave me the not connected error message.

There is something I can try though – and it may be what I’m supposed to do. Morbius1 has said I should connect using “guests” not “keith” so that might be where it could work.

Unfortunately, this didn’t seem to work. I typed in:

  • smb://kbfileserver.local/guest

And it gave me:

  • There was a problem connecting to the server “kbfileserver.local”

I also tried both “guest” and “guests” to no avail. I’m thinking that I’m getting close, but not quite there yet.

I have just jumped back to the forum to see that Morbius1 has made a comment, so I had some other things to try.

  • The same as above, but instead of guest, I should be writing “public” – which makes sense because that’s what we called the folder.
  • I should try pinging from the Mac to see if it connects.

The “public” thing didn’t work and the ping gave this error:

ping: cannot resolve kbfileserver.local: Unknown host

(By the way, the Terminal window on the Mac is on the launchpad under “Other”. You just click on it and it opens the terminal window.)

I’ll report back to the forum and see what comes out of my results.

 

 

 

 
Leave a comment

Posted by on February 7, 2014 in Nerdy Computer Stuff

 

Tags: , , , , , , , , ,

Installing Samba Server on Ubuntu Part III

The next instalment is possible due to more help on the ubuntu forum. Again Morbius1.

  • [1] Post your entire smb.conf since I really don’t know where you are any more. You can do that by issuing this command and posting it’s output to the forum:
cat /etc/samba/smb.conf

To that I replied…

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
#  – When such options are commented with “;”, the proposed setting
#    differs from the default Samba behaviour
#  – When commented with “#”, the proposed setting is the default
#    behaviour of Samba but the option is considered important
#    enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# “testparm” to check that you have not made any basic syntactic
# errors.
# A well-established practice is to name the original file
# “smb.conf.master” and create the “real” config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
# However, use this with caution if your smb.conf file contains nested
# “include” statements. See Debian bug #483187 for a case
# where using a master file is not a good idea.
#
#======================= Global Settings =======================
[global]
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP
# server string is the equivalent of the NT Description field
   server string = %h server (Samba, Ubuntu)
# Windows Internet Name Serving Support Section:
# WINS Support – Tells the NMBD component of Samba to enable its WINS Server
#   wins support = no
# WINS Server – Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z
# This will prevent nmbd to search for NetBIOS names through DNS.
   dns proxy = no
# What naming service and in what order should we use to resolve host names
# to IP addresses
;   name resolve order = lmhosts host wins bcast
#### Networking ####
# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0
# Only bind to the named interfaces and/or networks; you must use the
# ‘interfaces’ option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = yes
#### Debugging/Accounting ####
# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m
# Cap the size of the individual log files (in KiB).
   max log size = 1000
# If you want Samba to only log through syslog then set the following
# parameter to ‘yes’.
#   syslog only = no
# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
   syslog = 0
# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d
####### Authentication #######
# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = user
username map = /etc/samba/smbusers
# You may wish to use password encryption.  See the section on
# ‘encrypt passwords’ in the smb.conf(5) manpage before enabling.
   encrypt passwords = true
# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
   passdb backend = tdbsam
   obey pam restrictions = yes
# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
   unix password sync = yes
# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n
*password\supdated\ssuccessfully* .
# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# ‘passwd program’. The default is ‘no’.
   pam password change = yes
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user
########## Domains ###########
# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the ‘domain master’ setting to no
#
;   domain logons = yes
#
# The following setting only takes effect if ‘domain logons’ is set
# It specifies the location of the user’s profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
;   logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user’s home directory
# (this is Samba’s default)
#   logon path = \\%N\%U\profile
# The following setting only takes effect if ‘domain logons’ is set
# It specifies the location of a user’s home directory (from the client
# point of view)
;   logon drive = H:
#   logon home = \\%N\%U
# The following setting only takes effect if ‘domain logons’ is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in ‘DOS’ file format convention
;   logon script = logon.cmd
# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe.  The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser –quiet –disabled-password –gecos “” %u
# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a “machines” group exists on the system
; add machine script  = /usr/sbin/useradd -g machines -c “%u machine account” -d
/var/lib/samba -s /bin/false %u
# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup –force-badname %g
########## Printing ##########
# If you want to automatically load your printer list rather
# than setting them up individually then you’ll need this
#   load printers = yes
# lpr(ng) printing. You may wish to override the location of the
# printcap file
;   printing = bsd
;   printcap name = /etc/printcap
# CUPS printing.  See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
;   printing = cups
;   printcap name = cups
############ Misc ############
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
;   include = /home/samba/etc/smb.conf.%m
# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
#         SO_RCVBUF=8192 SO_SNDBUF=8192
#   socket options = TCP_NODELAY
# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
;   message command = /bin/sh -c ‘/usr/bin/linpopup “%f” “%m” %s; rm %s’ &
# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to ‘no’; otherwise, the default behavior is recommended.
#   domain master = auto
# Some defaults for winbind (make sure you’re not using the ranges
# for something else.)
;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash
# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
;   winbind enum groups = yes
;   winbind enum users = yes
# Setup usershare options to enable non-root users to share folders
# with the net usershare command.
# Maximum number of usershare. 0 (default) means that usershare is disabled.
;   usershare max shares = 100
# Allow users who’ve been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes
#======================= Share Definitions =======================
# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user’s home director as \\server\username
[homes]
comment = Home Directories
browseable = yes
# By default, the home directories are exported read-only. Change the
# next parameter to ‘no’ if you want to be able to write to them.
read only = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
;   create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
;   directory mask = 0700
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only “username” can connect to \\server\username
# The following parameter makes sure that only “username” can connect
#
# This might need tweaking when using external authentication schemes
valid users = %S
# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes
# Un-comment the following and create the profiles directory to store
# users profiles (see the “logon path” option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700
[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700
# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace ‘lpadmin’ with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin
# A sample share for sharing your CD-ROM with others.
;[cdrom]
;   comment = Samba server’s CD-ROM
;   read only = yes
;   locking = no
;   path = /cdrom
;   guest ok = yes
# The next two parameters show how to auto-mount a CD-ROM when the
#cdrom share is accesed. For this to work /etc/fstab must contain
#an entry like this:
#
#       /dev/scd0   /cdrom  iso9660 defaults,noauto,ro,user   0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#

The next step after that was to carry out a set of instructions – changes to the conf file. I’m kinda starting to get this all now – the conf file is where all the configuration is set up and it’s a matter of making some changes there to fix the problem. I just have to remember to open the conf file in the pop up window – it’s not in the same place as the Terminal window.

  • [2] What I’m going to suggest is removing the [homes] share entirely. It’s introducing a level of complexity that’s just getting in the way at the moment.

Okay, so this means I have to remember how to bring up the pop up conf file window. Looking back at my previous posts, I have to do this to bring up the window:

sudo gedit /etc/samba/smb.conf

So again, I assume this is the power-word “sudo” to be able to change the file and “gedit” is some sort of edit command. The file path (location) of the configuration file (smb.conf) is the last part of the command.

Looking at the code in the window that comes up, I’m trying to work out which section to remove entirely. I mean I get what Morbius1 is saying – I think. Each section seems to start with a parenthetical title (eg, [homes] or [global]) so I’m going to assume that Morbius1 is saying to delete everything starting with [homes] and ending just before the next bracketed title.

That looks like this:

 # user’s home director as \\server\username

[homes]
comment = Home Directories
browseable = yes
# By default, the home directories are exported read-only. Change the
# next parameter to ‘no’ if you want to be able to write to them.
read only = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
;   create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
;   directory mask = 0700
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only “username” can connect to \\server\username
# The following parameter makes sure that only “username” can connect
#
# This might need tweaking when using external authentication schemes
valid users = %S

*** EDIT: UPDATE ***

I got this wrong when I did this part and paid for it later. However, at least I know where I went wrong and that’s great news.

Above where it says “browseable = yes” – don’t comment that one out. Keep it in. That was my big mistake.

It’s impossible for my Mac to find the folder because I’ve told the config file that I don’t want people (like my Mac) to be able to browse for it!

*** END EDIT: UPDATE ***

The next part seemed to be part of another section [net logon] or something. But the actual title bit had a semi-colon against it. Thinking back, I believe this means it’s been commented out. And if you remember my previous post, this means that it won’t be read by the computer and therefore almost deleted, but there for reference.

That got me to thinking that maybe I could just put in semi-colons instead of deleting stuff from my .conf file. That seems to make much more sense because I can always include it again if I need to. Glad I didn’t just jump and delete that!

This means that [homes], comment= and valid users= have now been commented out and no longer apply to the config. Done. 🙂  [** Edit: I have removed the browseable=yes part from here **]

The next instruction is:

  • [3] Then I want to add a line in the [global] section – right under the workgroup line:
name resolve order = bcast host lmhosts wins

The global section is right at the top, so pretty easy to find. I will add it in under the following:

[global]
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP

Now that’s done and I can finish off with the conf file. To do that I have to save the pop up window. I found Save in the menu bar at the top, so that worked out well. Once saved, I closed the window with the red X and then it took me back to the Terminal window.

There’s more to do yet, but that’s the next post…

 
1 Comment

Posted by on February 7, 2014 in Nerdy Computer Stuff

 

Tags: , , , , , , , , ,

Installing Samba Server on Ubuntu Part II

So, after the last tutorial and battle with ubuntu, I’m no further along towards my objective, but more experienced. 🙂

I have turned to the ubuntu forums to seek advice and help. Turns out there are some awesome people there who are willing to help. Hopefully my issue can help others on the forum as well. Here’s the edited highlights of the thread. If you want to see the original, it’s here: http://ubuntuforums.org/showthread.php?t=2203514

I was asked to restart smbd which is supposed to be the Samba daemon (application that runs Samba in the background) but it didn’t help me at all. It’s all just trouble shooting, I guess. Here’s what I did – bold was the reply – in the Terminal window.

sudo restart smbd
smbd start/running, process 2782
sudo status smbd
smbd start/running, process 2782

That didn’t seem to be getting me anywhere, so the next step is to give more information. The follow information is the command they asked me to run and the result (command in bold). And of course this was run from the Terminal window (I’m getting the hang of just hitting Crtl-Alt-T to bring the window up).

  • testparm -s

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section “[homes]”
Processing section “[printers]”
Processing section “[print$]”
Loaded services file OK.
Server role: ROLE_STANDALONE
[global]
server string = %h server (Samba, Ubuntu)
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
username map = /etc/samba/smbusers
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb

[homes]
comment = Home Directories
valid users = %S

[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
print ok = Yes
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers

  • net usershare info --long

[Documents]
path=/home/keith/Desktop/Documents
comment=
usershare_acl=Everyone:F,
guest_ok=y

  • smbtree

WORKGROUP
\\KBFILESERVER KBFileServer server (Samba, Ubuntu)
\\KBFILESERVER\Documents 
\\KBFILESERVER\keith Home Directories
\\KBFILESERVER\IPC$ IPC Service (KBFileServer server (Samba, Ubuntu))
\\KBFILESERVER\print$ Printer Drivers
\\KBFILESERVER\homes Home Directories

So that’s pretty much it for all the info. They then asked me to try some things. Here’s the commands and the results.

  • sudo restart nmbd

nmbd start/running, process 2586

This didn’t seem to have any effect, but I tried it anyway. The next step was to try to get me connecting to the Mac. The ubuntu forum user Morbius1 (http://ubuntuforums.org/member.php?u=982144) helped me through the steps:

  • If you are talking about the [homes] share you won’t be able to connect to it unless you access it a certain way
  • Create a samba password for keith:
  • sudo smbpasswd -a keith

I did this already iin the last tutorial, but it can’t hurt. I got the same result, though. It asked me for the sudo password (I assume because it’s making serious changes) and then asked me for my samba password. I then confirmed the password and iot sent me back to the prompt.

  • From the mac Connect to Server it should be like this
  • Finder > Go > Connect to Server >Server Address
  • smb://kbfileserver.local/keith

This is on the Mac itself now. I opened a new Finder window then from the menu bar at the top, I clicked on the word Go. It dropped down a list where I found “Connect to Server” at the bottom of the list. Once I did that a little box popped up.

In the box, it asked me for my server address and then I hit to hit the little plus symbol beside it to add it to the list of favourite servers the Mac is connected to. It was then added to the list, I clicked on it to highlight it and then hit the Connect button. It searched for a while, but came up blank. This was the error message:

The server may not exist or it is unavailable at this time. Check the server name or IP address, check your network connection, and then try again.

Almost in preparation for this, Morbius1 suggested an alternative.

  • You may have to pass the username twice:
  • smb://keith@kbfileserver.local/keith

Unfortunately, it came up with the same error as above. Unable to connect. Weird.

The next piece of advice from Morbius1 was the following:

  • the one thing you do not want to do is have 2 share definitions for the same path so if you create a share definition in smb.conf delete the one you created in Nautilus. You can do it graphically or by command:
  • net usershare delete documents

I entered that at the prompt on the terminal and pressed enter. A new line showed up, but nothing seemed like it had done anything. I tried to reconnect on the mac to the server address that I have mentioned above (both of them) and still the same error message. It seems to me that I’m still not allowing the mac to visit. 😦

Posting now to see what happens next.

[Big thanks to Morbius1 (http://ubuntuforums.org/member.php?u=982144 ) and TheFu (http://ubuntuforums.org/member.php?u=1037685) and everyone else on the forum that has chimed in so far.]

 

 

 

 
Leave a comment

Posted by on February 5, 2014 in Nerdy Computer Stuff

 

Tags: , , , , , , , ,

Installing Samba Server on Ubuntu

I’m putting this here almost for my own reference, but hopefully to help others.

I’ve installed ubuntu on an old net book that was too slow. All I want to do is set it up as a file server on my wireless network. This is proving most challenging, but I’m learning a lot. The biggest problem I’m having is not understanding tutorials due to them often missing steps that they take for granted.

I don’t know ANYTHING. I’m battling through this with no knowledge or experience.

By adding to another tutorial I found, hopefully this will be literally a dummy’s guide for installing Samba on ubuntu. The original tutorial is here: http://www.howtogeek.com/howto/ubuntu/install-samba-server-on-ubuntu/

  • If you want to share files between your Ubuntu and Windows computers, your best option is to use Samba file sharing.
  • To install, first open a terminal window and enter the following command:

[To open a terminal window, press Crtl – Alt – ‘T’ or search for the application “Terminal”. Once you’re running it, there will be a window pop up that’s black with a blinking white cursor. This is where you write the stuff they suggest]

sudo apt-get install samba smbfs

[Now apparently this sudo thing is like some sort of “I’m doing something serious now” command and the apt-get install thing is the action – samba smbfs would be the application itself (I’m guessing). Sometimes it will ask you for a password so it can get on with it’s “something serious”. If that happens you just type in your system password and it happily keeps processing]

  • We’ve got samba installed, but now we’ll need to configure it to make it accessible. Run the following command to open the configuration file, substituting your editor of choice:

[For some reason the damn thing isn’t finished or something and needs to be configured manually. By you. When you put in the following command (straight after the last one in the black window with the white cursor) it will open a new window. This new window will just be code for configuration. Lucky, they’ve put in lots of explanations on how the configuration thing works. Unfortunately they’ve written it in Nerd. This whole “substituting your editor of choice” is unknown to me, but when I typed in the following command everything seemed to work.]

sudo gedit /etc/samba/smb.conf

  • Find this section in the file:

[Okay, there’s going to be a hell of a lot of code. The key is looking for the “#### Authentication #####” bit. There will be hundreds of sections in the config file (the pop up with code) and each one is like a box with hash tags around it. Find the box with the Authentication heading and the text below. It will be somewhere near the top, so it shouldn’t take too long.]

####### Authentication #######

# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
;  security = user

  • Uncomment the security line, and add another line to make it look like this:

[Alright, now, because the boxes I was talking about above are not part of the code, they need to have a way to distinguish them from code lines. This is the hash tag. Where ever the hash tag starts a line, it means it’s a comment and therefore can be ignored. In fact, the act of putting a hash tag in front of a comment is called “commenting”. So, where you are asked to “uncomment” it means to remove the hash tag, or in this case a semi-colon. Once the semi-colon is removed and the extra line is added beneath, it will look like this:]

security = user
username map = /etc/samba/smbusers

[When you’ve added these lines, you then have to save the file. I found an icon in the top bar of the pop up window that said Save, so I went with that. After it’s saved, I closed the box (X in the corner) and then it went straight back to the prompt and the white cursor.]

  • This will set Samba to use the smbusers file for looking up the user list.

[Samba works out who can use it based on a table that is a user list. In this command, I think what you’re trying to do is tell Samba to use the table you have provided for the users.

Create a Samba User

  • There are two steps to creating a user. First we’ll run the smbpasswd utility to create a samba password for the user.

sudo smbpasswd -a <username>

[This is where I came off the rails. So, you’re using the sudo thing again, that’s fine. I think it’s trying to run the “smbpasswd” utility and adding someone called <username>. I found out the hard way that the name in the “<>” should be replaced by your actual username. So here’s what I did.

I went into the search part and typed in “user”. It showed me an app called “User Accounts” and I clicked on it. When the new screen opened, it had my user on it (me). So I used the same user name.

For example, if my username was Jerry, I would type “sudo smbpasswd -a Jerry” and then hit enter.

When I did this, it came up and asked me firstly for my sudo password, which I put in (as discussed above).

Then it asked me for my “New SMB password:” – I used the same password as the system password. I hope this doesn’t cause problems. It seemed to accept it. It then asked me to “Retype new SMB password:” so I typed the same password again. It then gave me a message saying it had “Added user Jerry.” (If I had used Jerry as my username)]

  • Next, we’ll add that username to the smbusers file.

sudo gedit /etc/samba/smbusers

[Remembering from before that the smbusers file is that table that has the users in it, I kind of got where this was going. The sudo I’m now familiar with, but I don’t know what gedit is – I think it’s allows you to edit a file because a new window opens that looks like a text box.]

  • Add in the following line, substituting the username with the one you want to give access to. The format is <ubuntuusername> = “<samba username>”.  You can use a different samba user name to map to an ubuntu account, but that’s not really necessary right now.

<username> = “<username>”

[This blows my mind. Since the file is empty, you’re creating the first line. There’s no need to do anything apart from type the one line, save it and close the pop up window. Then you can head back to the prompt and the white cursor for the next command.

What to write is the hard thing. If you did what I did and used the system username for the samba username, this gets kind of easy. Using my previous example, you would type: Jerry = Jerry

If you used different usernames, then the system username (ubuntuusername) goes first and the proposed Samba username comes on the other side of the equals sign: Jerry = SambaJerry]

  • Now you can create samba shares and give access to the users that you listed here.

[And that’s the end of the tutorial! Apparently that’s all you need to do.

Next, though is a link to the next step of the process – sharing files. This original tutorial is here: http://www.howtogeek.com/howto/ubuntu/share-ubuntu-home-directories-using-samba/

Hopefully you’ve left your Terminal window up – you’ll still be using that.]

  • To share the home directories, open up smb.conf with the following command:

[The below command will open up the configuration file (pop up window). It’s the same one you opened before with all the code in it.]

sudo gedit /etc/samba/smb.conf

  • Find this section of the file, and make it match the following:

[This time, instead of looking for “Authentication”, you’re looking for “Share Definitions”. It’s the very last one, so it’s right at the bottom.]

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user’s home directory as \\server\username
[homes]
comment = Home Directories
browseable = yes

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only “username” can connect to \\server\username
valid users = %S

# By default, the home directories are exported read-only. Change next
# parameter to ‘yes’ if you want to be able to write to them.
writable = yes

[The “uncommenting” is done by removing the semi-colon against “[Homes]”, “comment = Home Directories” and “browseable = yes”. You’ll also need to change the no to yes on the browseable one.

On mine, instead of “writable = yes”, I had “read only = yes” so I changed it to “no” and I assume it means the same thing. Maybe it’s a version thing. The read only section still had the same comment in front of it, though. I just removed the semi-colon and changed it to “no”.

A bit further down I found the valid users thing and took out the semi-colon in front of it as well. That was the last change, so I saved the file and closed the pop up window.]

[Once the above is complete, you can shut down the Terminal window. I also restarted my machine just in case. (Don’t know if that helps or not).]

  • Now you should be able to map a drive on windows using the following share format:

\\ubuntumachine\username

And that’s how the tutorial goes. However, it didn’t work for me. I still can’t get Samba to run.

I’m actually going to try other things now – I’ll see how it goes.

 
Leave a comment

Posted by on February 4, 2014 in Nerdy Computer Stuff

 

Tags: , , , , , , , ,

 
%d bloggers like this: