Home » Questions » Computers [ Ask a new question ]

How do I get back the default Samba configuration file (Debian-based system)?

How do I get back the default Samba configuration file (Debian-based system)?

I recently installed Samba and I messed up the /etc/samba/smb.conf file. How do I get the original configuration back?

Asked by: Guest | Views: 261
Total answers/comments: 4
bert [Entry]

"The best way (gotten from #ubuntu) is to do this:

dpkg-reconfigure <package>

In this case that means

dpkg-reconfigure samba-common"
bert [Entry]

"You can restore the original smb.conf configuration file like this:

# cp /usr/share/samba/smb.conf /etc/samba/smb.conf
# dpkg-reconfigure samba-common

This is basically what the original package installation process does (on Debian Squeeze).

This will overwrite you current smb.conf, so make a backup first if you don't want to lose it."
bert [Entry]

"You can extract the deb and grab the original file:

ar p packagename.deb data.tar.gz | tar zx"
"You can extract the deb and grab the original file:

ar p packagename.deb data.tar.gz | tar zx"
bert [Entry]

"$ sudo cp /usr/share/samba/smb.conf /etc/samba/smb.conf

and

$ sudo dpkg --configure -a

will do the job."