To edit files as a superuser you may also consider using "nano" text editor that works within bash as "vi" but much more simple:

Code:
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup

sudo nano /etc/samba/smb.conf
Click image for larger version. 

Name:	nano.png 
Views:	10 
Size:	77.0 KB 
ID:	181711