graedus
11-23-2007, 04:55 PM
The following procedures should be done providing root credentials. To obtain root credentials, open up Konsole (kmenu->System->Konsole), type su , and provide your administrative password. If you are not savvy with the shell, you can edit files issuing the following command from kmenu-> Run command: kdesu kwrite, and then locating by hand the file. You should be careful with what files you open, as if you mistake you might break something.
1. Setting up a custom hostname.
--------------------------------
PCBSD sets up the same hostname (computer name) for every install performed (pcbsd is the hostname) If you have more than one computer in the network, it would be advisable that each one has a different hostname.
Edit /etc/rc.conf. Search for the following line, and change pcbsd to a more suitable name.
hostname="pcbsd"
Edit /etc/hosts. This is the default /etc/hosts file:
# : src/etc/hosts,v 1.16 2003/01/28 21:29:23 dbaker Exp $
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file. Replace 'my.domain' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
::1 localhost localhost.localdomain pcbsd.localhost pcbsd
127.0.0.1 localhost localhost.localdomain pcbsd.localhost pcbsd
#
# Imaginary network.
#10.0.0.2 myname.my.domain myname
#10.0.0.3 myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
# 10.0.0.0 - 10.255.255.255
# 172.16.0.0 - 172.31.255.255
# 192.168.0.0 - 192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers. Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
Replace all the "pcbsd" instances with the new name you provided on the rc.conf file just edited.
2. Disable Firewall
-------------------
Note: Disabling your firewall altogether is not a good idea if you don't trust your local network and don't have a hardware firewall between your network and the internet. Do this at your own risk. Providing a customized pf script trying to address each particular network configuration of yours is out of the scope of a "quick and dirty" setup.
Control Center > System Administration > Services Manager
Click on PF(Personal Firewall), then choose "Stop" and "Disable at Startup"
or do it by hand:
change the following on /etc/rc.conf :
frompf_enable="YES"
pf_rules_enable="YES"
topf_enable="NO"
pf_rules_enable="NO"
*Add the following line to /etc/hosts.allow, just below #ALL : ALL : allow
ALL : LOCAL : ALLOW
(this line can be fine tuned to allow only what you need, check man 5 hosts_options and man 5 hosts_access)
3. Setting up NFS
Depending on your setup, you might want to enable just NFS client or both client and server.
Add the following lines to /etc/rc.conf
#Enable NFS Client
nfs_client_enable="YES"
nfs_client_flags="-n 4"
#Enable NFS Server
rpcbind_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
mountd_flags="-r"
Add an /etc/exports file. Example:
#The following examples export /usr to 3 machines named after ducks,
#/usr/src and /usr/ports read-only to machines named after trouble makers
#/home and all directories under it to machines named after dead rock stars
#and, /a to a network of privileged machines allowed to write on it as root.
#/usr huey louie dewie
#/usr/src /usr/obj -ro calvin hobbes
#/home -alldirs janice jimmy frank
#/a -maproot=0 -network 10.0.1.0 -mask 255.255.248.0
#
# You should replace these lines with your actual exported filesystems.
# Note that BSD's export syntax is 'host-centric' vs. Sun's 'FS-centric' one.
/exportpath -alldirs -maproot=root allowedhostname
For more information on how to set up the exports file, check man exports.
To remotely mount the filesystem, issue the following command:
mount hostname:/exportpath /mountpoint
where hostname is the name of the computer acting as nfs host, exportpath is the path you set on the exports file, and /mountpoint is the directory to which this filesystem will be mounted (it has to be a directory owned by the mounter and empty).
To see the host's exports list, issue this command:
showmount -e hostname
4. Setting up Samba
Find where the smb.conf file is located:
smbd -b | grep smb.conf
In this case, it is located on /usr/local/etc/smb.conf
Adjust the following line in smb.conf (example: /usr/local/etc/smb.conf )
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
workgroup = MYGROUP
Append (add at the end) your shared folders (example):
[public]
path = /usr/somewhere/else/public
public = yes
only guest = yes
writable = yes
printable = no
Check the examples provided at the end of the smb.conf file, also check man smb.conf
Add users using smbpasswd (example):
smbpasswd -a username
(the command will prompt for a password to be created)
And that's it. You should be able to see the samba shares and remotely mount using nfs.
Online References:
http://trac.pcbsd.org/ticket/6
http://www.freebsd.org/doc/en_US.ISO885 ... k-nfs.html (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-nfs.html)
http://us4.samba.org/samba/docs/man/Sam ... l#id318178 (http://us4.samba.org/samba/docs/man/Samba-HOWTO-Collection/install.html#id318178)
1. Setting up a custom hostname.
--------------------------------
PCBSD sets up the same hostname (computer name) for every install performed (pcbsd is the hostname) If you have more than one computer in the network, it would be advisable that each one has a different hostname.
Edit /etc/rc.conf. Search for the following line, and change pcbsd to a more suitable name.
hostname="pcbsd"
Edit /etc/hosts. This is the default /etc/hosts file:
# : src/etc/hosts,v 1.16 2003/01/28 21:29:23 dbaker Exp $
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file. Replace 'my.domain' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
::1 localhost localhost.localdomain pcbsd.localhost pcbsd
127.0.0.1 localhost localhost.localdomain pcbsd.localhost pcbsd
#
# Imaginary network.
#10.0.0.2 myname.my.domain myname
#10.0.0.3 myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
# 10.0.0.0 - 10.255.255.255
# 172.16.0.0 - 172.31.255.255
# 192.168.0.0 - 192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers. Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
Replace all the "pcbsd" instances with the new name you provided on the rc.conf file just edited.
2. Disable Firewall
-------------------
Note: Disabling your firewall altogether is not a good idea if you don't trust your local network and don't have a hardware firewall between your network and the internet. Do this at your own risk. Providing a customized pf script trying to address each particular network configuration of yours is out of the scope of a "quick and dirty" setup.
Control Center > System Administration > Services Manager
Click on PF(Personal Firewall), then choose "Stop" and "Disable at Startup"
or do it by hand:
change the following on /etc/rc.conf :
frompf_enable="YES"
pf_rules_enable="YES"
topf_enable="NO"
pf_rules_enable="NO"
*Add the following line to /etc/hosts.allow, just below #ALL : ALL : allow
ALL : LOCAL : ALLOW
(this line can be fine tuned to allow only what you need, check man 5 hosts_options and man 5 hosts_access)
3. Setting up NFS
Depending on your setup, you might want to enable just NFS client or both client and server.
Add the following lines to /etc/rc.conf
#Enable NFS Client
nfs_client_enable="YES"
nfs_client_flags="-n 4"
#Enable NFS Server
rpcbind_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
mountd_flags="-r"
Add an /etc/exports file. Example:
#The following examples export /usr to 3 machines named after ducks,
#/usr/src and /usr/ports read-only to machines named after trouble makers
#/home and all directories under it to machines named after dead rock stars
#and, /a to a network of privileged machines allowed to write on it as root.
#/usr huey louie dewie
#/usr/src /usr/obj -ro calvin hobbes
#/home -alldirs janice jimmy frank
#/a -maproot=0 -network 10.0.1.0 -mask 255.255.248.0
#
# You should replace these lines with your actual exported filesystems.
# Note that BSD's export syntax is 'host-centric' vs. Sun's 'FS-centric' one.
/exportpath -alldirs -maproot=root allowedhostname
For more information on how to set up the exports file, check man exports.
To remotely mount the filesystem, issue the following command:
mount hostname:/exportpath /mountpoint
where hostname is the name of the computer acting as nfs host, exportpath is the path you set on the exports file, and /mountpoint is the directory to which this filesystem will be mounted (it has to be a directory owned by the mounter and empty).
To see the host's exports list, issue this command:
showmount -e hostname
4. Setting up Samba
Find where the smb.conf file is located:
smbd -b | grep smb.conf
In this case, it is located on /usr/local/etc/smb.conf
Adjust the following line in smb.conf (example: /usr/local/etc/smb.conf )
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
workgroup = MYGROUP
Append (add at the end) your shared folders (example):
[public]
path = /usr/somewhere/else/public
public = yes
only guest = yes
writable = yes
printable = no
Check the examples provided at the end of the smb.conf file, also check man smb.conf
Add users using smbpasswd (example):
smbpasswd -a username
(the command will prompt for a password to be created)
And that's it. You should be able to see the samba shares and remotely mount using nfs.
Online References:
http://trac.pcbsd.org/ticket/6
http://www.freebsd.org/doc/en_US.ISO885 ... k-nfs.html (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-nfs.html)
http://us4.samba.org/samba/docs/man/Sam ... l#id318178 (http://us4.samba.org/samba/docs/man/Samba-HOWTO-Collection/install.html#id318178)