soup4you2
October 23rd, 2003, 20:35
Ok here's a rather unique question.
say you setup a freebsd jail. you cant ping or do anything on the outside... so hows one supposed to setup a process like postfix where it checks to see if the domain exists?
well the overall goal in my project is i've make it so i can jail specific ssh users or groups to their own jailed enviroment.. but certain users i would still like to be able to use irc or whatever they do.. plus it's nice having ssh users without actually needing a valid system account. the ssh jailing portion works great so far.. ie see below:
[code:1:a691fef853]
Sep 16 19:32:35 XXXXXXXXX sshd[86775]: Connection from XX.XX.XX.XX port 49526
Sep 16 19:32:36 XXXXXXXXX sshd[86775]: Jailing session. [user=USERNAME,chroot=/chroot/sshd/USERNAME]
[/code:1:a691fef853]
but i want them to have outside access, any thoughts?
if it helps here's some background info:
rc.conf settings
[code:1:a691fef853]
jail_set_hostname_allow="NO"
jail_socket_unixiproute_only="YES"
jail_sysvipc_allow="NO"
jail_stop_jailer="NO"
jail_sshd_rootdir="/chroot/sshd/jail"
jail_sshd_hostname="solarflare.bsdhound.com"
jail_sshd_ip="10.0.4.1"
jail_sshd_exec="/bin/sh /etc/rc"
jail_sshd_devfs_enable="YES"
jail_sshd_fdescfs_enable="NO"
jail_sshd_procfs_enable="NO"
jail_sshd_devfs_ruleset="11"
[/code:1:a691fef853]
the devfs rulesets are basically:
[code:1:a691fef853]
[devfsrules_jail_sshd=11]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
[/code:1:a691fef853]
Now i've even assigned some pf rules to try to redirect the traffic though squid.
[code:1:a691fef853]# Solarflair Access
rdr on $int_if proto tcp from $solarflair to any port 80 -> 10.0.2.1 port 3128
rdr on $int_if proto tcp from $solarflair to any port 443 -> 10.0.2.1 port 3128
rdr on $int_if proto tcp from $solarflair to any port 563 -> 10.0.2.1 port 3128
rdr on $int_if proto tcp from $solarflair to any port 21 -> 10.0.2.1 port 3128
rdr on $int_if proto tcp from $solarflair to any port 1025:65535 -> 10.0.2.1 port 3128
rdr on $int_if proto tcp from $solarflair to any port 53 -> 10.0.3.1 port 53
rdr on $int_if proto udp from $solarflair to any port 53 -> 10.0.3.1 port 53
[/code:1:a691fef853]
Now if i go into the jail like normal either by
jail /chroot/sshd/jail solarflair 10.0.4.1 /bin/sh
or by
jls 11 /bin/sh
i can browse around just fine.. Anybody know of ways i can enable networking inside the jail?
i guess i could take the wimpie way outta this and write a login script to jail their session then logout once leaving the jail but the goal is to keep ssh accounts seperate from system accounts.
say you setup a freebsd jail. you cant ping or do anything on the outside... so hows one supposed to setup a process like postfix where it checks to see if the domain exists?
well the overall goal in my project is i've make it so i can jail specific ssh users or groups to their own jailed enviroment.. but certain users i would still like to be able to use irc or whatever they do.. plus it's nice having ssh users without actually needing a valid system account. the ssh jailing portion works great so far.. ie see below:
[code:1:a691fef853]
Sep 16 19:32:35 XXXXXXXXX sshd[86775]: Connection from XX.XX.XX.XX port 49526
Sep 16 19:32:36 XXXXXXXXX sshd[86775]: Jailing session. [user=USERNAME,chroot=/chroot/sshd/USERNAME]
[/code:1:a691fef853]
but i want them to have outside access, any thoughts?
if it helps here's some background info:
rc.conf settings
[code:1:a691fef853]
jail_set_hostname_allow="NO"
jail_socket_unixiproute_only="YES"
jail_sysvipc_allow="NO"
jail_stop_jailer="NO"
jail_sshd_rootdir="/chroot/sshd/jail"
jail_sshd_hostname="solarflare.bsdhound.com"
jail_sshd_ip="10.0.4.1"
jail_sshd_exec="/bin/sh /etc/rc"
jail_sshd_devfs_enable="YES"
jail_sshd_fdescfs_enable="NO"
jail_sshd_procfs_enable="NO"
jail_sshd_devfs_ruleset="11"
[/code:1:a691fef853]
the devfs rulesets are basically:
[code:1:a691fef853]
[devfsrules_jail_sshd=11]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
[/code:1:a691fef853]
Now i've even assigned some pf rules to try to redirect the traffic though squid.
[code:1:a691fef853]# Solarflair Access
rdr on $int_if proto tcp from $solarflair to any port 80 -> 10.0.2.1 port 3128
rdr on $int_if proto tcp from $solarflair to any port 443 -> 10.0.2.1 port 3128
rdr on $int_if proto tcp from $solarflair to any port 563 -> 10.0.2.1 port 3128
rdr on $int_if proto tcp from $solarflair to any port 21 -> 10.0.2.1 port 3128
rdr on $int_if proto tcp from $solarflair to any port 1025:65535 -> 10.0.2.1 port 3128
rdr on $int_if proto tcp from $solarflair to any port 53 -> 10.0.3.1 port 53
rdr on $int_if proto udp from $solarflair to any port 53 -> 10.0.3.1 port 53
[/code:1:a691fef853]
Now if i go into the jail like normal either by
jail /chroot/sshd/jail solarflair 10.0.4.1 /bin/sh
or by
jls 11 /bin/sh
i can browse around just fine.. Anybody know of ways i can enable networking inside the jail?
i guess i could take the wimpie way outta this and write a login script to jail their session then logout once leaving the jail but the goal is to keep ssh accounts seperate from system accounts.