Puppy Linux Blog


This Blog:
PRITLOG is an extremely simple, small and powerful blog system. 
Just drop Pritlog into your server and it starts running. No separate installation is required. The basic idea is derived from a similar app called PPLOG.


Users Online: 0
Hits: 0

secure /tmp on servers

Check if /tmp is already secure. Some servers do not use a /tmp partition while others do.
df -h |grep tmp

If that displays nothing then go below to create a tmp partition. If you do have a tmp partition you need to see if it mounted with noexec.
cat /etc/fstab |grep tmp

If there is a line that includes /tmp and noexec then it is already mounted as non-executable. If not follow the instructions below to create one without having to physically format your disk. Idealy you would make a real partition when the disk was originally formated, that being said I have not had any trouble create a /tmp partition using the following method.

Create a ~800Mb partition
cd /dev/; dd if=/dev/zero of=tmpMnt bs=1024 count=800000

Format the partion
mkfs.ext2 /dev/tmpMnt
When it asks about not being a block special device press Y

Make a backup of the old data
cp -Rp /tmp /tmp_backup

Mount the temp filesystem
mount -o loop,noexec,nosuid,rw /dev/tmpMnt /tmp

Set the permissions
chmod 0777 /tmp

Copy the old files back
cp -Rp /tmp_backup/* /tmp/

Once you do that go ahead and restart mysql and make sure it works ok. We do this because mysql places the mysql.sock in /tmp which neeeds to be moved. If not it migth have trouble starting. If it does you can add this line to the bottom of the /etc/fstab to automatically have it mounted:

Open the file in pico:
pico -w /etc/fstab

Now add this single line at the bottom:

/dev/tmpMnt /tmp ext2 loop,noexec,nosuid,rw 0 0

While we are at it we are going to secure /dev/shm. Look for the mount line for /dev/shm and change it to the following:
none /dev/shm tmpfs noexec,nosuid 0 0

Umount and remount /dev/shm for the changes to take effect.
umount /dev/shm
mount /dev/shm

Delete the old /var/tmp and create a link to /tmp
rm -rf /var/tmp/
ln -s /tmp/ /var/

If everything still works fine,  delete the /tmp_backup directory.
rm -rf /tmp_backup

Your /tmp, /var/tmp, and /dev/shm are now mounted in a way that no program can be directly run from these directories.

Author: admin -  Date: 12 Jan 2020 07:31
Category: linux -  Visits: 663

No Comments - Edit - Delete


Go to Services > VPN set-up page on DD-WRT router

enter address for the VPN server
enter port for the server
choose TUN for device
choose TCP for protocol
AES 256 for cipher
SHA 512 for algorithm
enable user password authorization
     enter username
     enter password
TLS cipher - none
LZO Comp - No
NAT enabled
Firewall enabled
    IP address - empty
    subnet mask - empty
tunnel mtu setting - 1500
Tunnel UDP Fragment - empty
Tunnel UDP MSS-Fix - enabled
nsCertType verification - unchecked

Author: admin -  Date: 06 Jan 2019 11:13
Category: networking -  Visits: 1016

No Comments - Edit - Delete


Connect to a remote machine via a SSH-secured connection and type on it's console to administer it.

This is very simple:

ssh user@remoteaddress

Move data between machines in an encrypted and secure way. It basicly works like the standard "cp" command, but it has got a different name: "scp"

scp /home/me/a_file.txt user@box_B:/home/me/

SSH offers the "-D" option to provide a SOCKS proxy on the local machine:

ssh -D 1234 user@box_B

You'll have a proxy listening on localhost port 1234. Now you just have to setup your webbrowser to use the "SOCKS proxy" on localhost port 1234 and all your surfing will go through Box B. You can check if it worked by visiting a website that shows your IP. 

Author: admin -  Date: 19 May 2018 04:03
Category: ssh -  Visits: 2283

No Comments - Edit - Delete


To find IP addresses accessing your computer:

# netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

Author: admin -  Date: 16 Apr 2016 06:15
Category: netstat -  Visits: 2769

No Comments - Edit - Delete

Author: admin -  Date:
Category:  -  Visits: 174

No Comments - Edit - Delete

Pages: [1] [2] [3]