sudo apt-get install smbfs
Put something like this in your fstab;
//ntserver/share /mnt/samba smbfs username=myusername,password=mypassword 0 0
Mount the drive;
sudo mount /mnt/samba
Your drive should now be accessible at /mnt/samba
sudo apt-get install smbfs
//ntserver/share /mnt/samba smbfs username=myusername,password=mypassword 0 0
sudo mount /mnt/samba
sudo apt-get install openssh-server
sudo vi /etc/ssh/sshd_config
Port 22
Port 443
sudo /etc/init.d/ssh restart
sudo adduser --system --group vpn
--system
parameter sets vpn's shell to /bin/false
but because the vpn user needs to log in via ssh, we must change this to /bin/bash
in the /etc/passwd
file.sudo vi /etc/passwd
vpn:x:110:110::/home/vpn:/bin/bash
sudo passwd vpn
ssh vpn@hostname
Once you have passwordless SSH properly configured between root@client and vpn@server you should change the password to a more secure (random) one if you haven't already done so it will no longer be needed.
visudo
vpn ALL=NOPASSWD: /usr/sbin/pppd
vpn ALL=NOPASSWD: /sbin/iptables
vpn ALL=NOPASSWD: /sbin/route
vi /home/vpn/returnroutes.sh
#!/bin/sh
sudo route add -net 10.48.0.0/16 gw 192.168.0.1
sudo route add -net 10.0.0.0/16 gw 192.168.0.1
chmod +x /home/vpn/returnroutes.sh
chown vpn:vpn /home/vpn/returnroutes.sh
sudo /usr/sbin/pppd noauth
~�}#�!}!}!} }4}"}&} } } } }%}&����}'}"}(}"��~
#!/bin/sh
# SCRIPT: vpn-connect version 2.2
# LOCATION: /usr/local/bin/vpn-connect
# DESCRIPTION: This script initiates a ppp-ssh vpn connection.
# see the VPN PPP-SSH HOWTO on http://www.linuxdoc.org
# for more information.
# NOTES: This script uses port 443 so your VPN server should be
# configured to listen for ssh on Port 443
#
# revision history:
# 1.6 11-Nov-1996 miquels@cistron.nl
# 1.7 20-Dec-1999 bart@jukie.net
# 2.0 16-May-2001 bronson@trestle.com
# 2.2 27-Sep-2009 brettg@tuxnetworks.com
#
# You will need to change these variables...
#
# The host name or IP address of the SSH server that we are
# sending the connection request to:
SERVER_HOSTNAME=tuxnetworks.homelinux.net
# The username on the VPN server that will run the tunnel.
# For security reasons, this should NOT be root. (Any user
# that can use PPP can intitiate the connection on the client)
SERVER_USERNAME=vpn
# The VPN network interface on the server should use this address:
SERVER_IFIPADDR=192.168.3.2
# ...and on the client, this address:
CLIENT_IFIPADDR=192.168.3.1
# This tells ssh to use unprivileged high ports, even though it's
# running as root. This way, you don't have to punch custom holes
# through your firewall.
LOCAL_SSH_OPTS="-P"
PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11/:
## required commands...
PPPD=/usr/sbin/pppd
SSH=/usr/bin/ssh
RETURNROUTES=/home/vpn/zenroutes.sh
if ! test -f $PPPD ; then echo "can't find $PPPD"; exit 3; fi
if ! test -f $SSH ; then echo "can't find $SSH"; exit 4; fi
case "$1" in
start)
# echo -n "Starting vpn to $SERVER_HOSTNAME: "
${PPPD} updetach noauth passive pty "${SSH} -p 443 ${LOCAL_SSH_OPTS} ${SERVER_HOSTNAME} -l${SERVER_USERNAME} -o Batchmode=yes sudo ${PPPD} nodetach notty noauth" ipparam vpn ${CLIENT_IFIPADDR}:${SERVER_IFIPADDR}
${SSH} -p 443 ${SERVER_HOSTNAME} -l ${SERVER_USERNAME} ${RETURNROUTES}
route add -net 10.1.0.0 netmask 255.255.0.0 gw $SERVER_IFIPADDR
# route add -net 10.2.0.0 netmask 255.255.0.0 gw $SERVER_IFIPADDR
# route add -net 192.0.0.0/8 gw $SERVER_IFIPADDR
;;
stop)
# echo -n "Stopping vpn to $SERVER_HOSTNAME: "
PID=`ps ax | grep "${SSH} -p 443 ${LOCAL_SSH_OPTS} ${SERVER_HOSTNAME} -l${SERVER_USERNAME} -o" | grep -v ' passive ' | grep -v 'grep ' | awk '{print $1}'`
if [ "${PID}" != "" ]; then
kill $PID
echo "disconnected."
else
echo "Failed to find PID for the connection"
fi
;;
config)
echo "SERVER_HOSTNAME=$SERVER_HOSTNAME"
echo "SERVER_USERNAME=$SERVER_USERNAME"
echo "SERVER_IFIPADDR=$SERVER_IFIPADDR"
echo "CLIENT_IFIPADDR=$CLIENT_IFIPADDR"
;;
*)
echo "Usage: vpn {start|stop|config}"
exit 1
;;
esac
exit 0
chmod +x /usr/local/bin/vpn-client
/usr/local/sbin/vpn-client start
ifconfig ppp0
ifconfig | grep ppp
vi /usr/local/sbin/vpn-check
#!/bin/sh
EMAIL=brettg@tuxnetworks.com
DAEMON=pppd
if [ "$(/bin/pidof $DAEMON)" = "" ]; then
/usr/local/sbin/vpn-client start
wait
if ! [ "$(/bin/pidof $DAEMON)" = "" ]; then
echo "VPN restarted $(date +%m-%d-%Y)"
fi
fi
vi /etc/crontab
* * * * * root /usr/local/sbin/vpn-check
/usr/local/sbin/vpn-client stop
sudo cp /etc/apt/sources.list /etc/apt/sources.list.d
sudo sed -i 's/jaunty/karmic/g' /etc/apt/sources.list.d/sources.list
sudo vi /etc/apt/preferences
Package: *
Pin: release a=jaunty
Pin-Priority: 900
Package: *
Pin: release a=karmic
Pin-Priority: 500
Package: *
Pin: release a=jaunty-updates
Pin-Priority: 900
Package: *
Pin: release a=karmic-updates
Pin-Priority: 500
Package: *
Pin: release a=jaunty-backports
Pin-Priority: 900
Package: *
Pin: release a=karmic-backports
Pin-Priority: 500
Package: *
Pin: release a=jaunty-security
Pin-Priority: 900
Package: *
Pin: release a=karmic-security
Pin-Priority: 500
Package: *
Pin: release a=jaunty-proposed
Pin-Priority: 900
Package: *
Pin: release a=karmic-proposed
Pin-Priority: 500
sudo apt-get update
apt-cache search linux-image
sudo apt-get install linux-image-2.6.31-10-386
sudo apt-get -t karmic install packagename
apt-get install nautilus=2.2.4-1
sudo apt-get install apache22 gcc make g++
sudo apt-get install mrtg
sudo vi /etc/mrtg.cfg
# Global Settings
RunAsDaemon: yes
EnableIPv6: no
WorkDir: /var/www/mrtg
Options[_]: bits,growright
WriteExpires: Yes
Title[^]: Traffic Analysis for
sudo :q!cfgmaker public@targetname > /etc/mrtg.cfg
sudo indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html
http://10.100.1.198/mrtg/
apt-get install snmp snmpd
vi /etc/default/snmpd
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
vi /etc/snmp/snmpd.conf
# sec.name source community
com2sec paranoid default public
#com2sec readonly default public
#com2sec readwrite default private
# sec.name source community
#com2sec paranoid default public
com2sec readonly default public
#com2sec readwrite default private
# sec.name source community
#com2sec paranoid default public
#com2sec readonly default public
#com2sec readwrite default private
com2sec readonly default MyCommunity
snmpwalk -Os -c public -v 1 localhost system
sudo apt-get install request-tracker3.6 rt3.6-apache2 \
rt3.6-clients mysql-server apache2
vi /etc/request-tracker3.6/RT_SiteConfig.pm
Set($DatabaseHost , ‘localhost’);
Set($DatabaseRTHost , ‘localhost’);
Set($rtname, 'support.example.com');
Set($Organization, 'example');
Set($CorrespondAddress , 'support@example.com');
Set($CommentAddress , 'comments@example.com');
Set($Timezone , 'Australia/Melbourne'); # obviously choose what suits you
# THE DATABASE:
Set($DatabaseType, 'mysql'); # e.g. Pg or mysql
# These are the settings we used above when creating the RT database,
# you MUST set these to what you chose in the section above.
Set($DatabaseUser , 'rtadmin');
Set($DatabasePassword , 'password');
Set($DatabaseName , 'rtdb');
Set($DatabaseHost , 'localhost');
Set($DatabaseRTHost , 'localhost');
# THE WEBSERVER:
Set($WebPath , "/rt");
Set($WebBaseURL , "http://support");
1;
mysql -u root -p
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX ON rtdb.* TO 'rtadmin'@'localhost' IDENTIFIED BY 'password';
quit;
sudo /usr/sbin/rt-setup-database-3.6 --action init --dba rtadmin --prompt-for-dba-password
Now creating a database for RT.
Creating mysql database rtdb.
Now populating database schema.
Creating database schema.
Done setting up database schema.
Now inserting database ACLs
Done setting up database ACLs.
Now inserting RT core system objects
Checking for existing system user...not found. This ap perlpears to be a new installation.
Creating system user...done.
Now inserting RT data
Creating Superuser ACL...done.
Creating groups...3.4.5.6.7.8.9.done.
Creating users...10.12.done.
Creating queues...1.2.done.
Creating ACL...2.3.done.
Creating ScripActions...1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.done.
Creating ScripConditions...1.2.3.4.5.6.7.8.9.10.done.
Creating templates...1.2.3.4.5.6.7.8.9.10.11.12.done.
Creating scrips...1.2.3.4.5.6.7.8.9.10.11.12.13.14.done.
Creating predefined searches...1.2.3.done.
Done setting up database content.
sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/
sudo a2enmod perl
sudo /etc/init.d/apache2 force-reload
http://servername/rt
ln -s /usr/local/myapp/bin/myapp /etc/init.d/myapp
update-rc.d myapp start 20 2 3 4 5 . stop 20 0 1 6 .
Adding system startup for /etc/init.d/myapp ...
/etc/rc0.d/K20myapp -> ../init.d/myapp
/etc/rc1.d/K20myapp -> ../init.d/myapp
/etc/rc6.d/K20myapp -> ../init.d/myapp
/etc/rc2.d/S20myapp -> ../init.d/myapp
/etc/rc3.d/S20myapp -> ../init.d/myapp
/etc/rc4.d/S20myapp -> ../init.d/myapp
/etc/rc5.d/S20myapp -> ../init.d/myapp
update-rc.d -f myapp remove
$ bgcommand &
$ nohup bgcommand
$ CTRL+Z
$ bg
$ disown -a