Secure shell (ssh) session timeout

I’ve noticed that when I keep ssh sessions that I opened before untouched for some period of time (like 30 minutes) they become frozen and as a result I have to close ssh terminal and start a new connection. To prevent such situation I found several tips: 1) Start some utility updating the screen before leaving ssh session untouched. I usually use watch -n 1 ‘date’ that shows current date […]

Read more →

 

Silent and unattended large file download with wget

If you would like to download large file like HD Video or Linux ISO image while you’re working at your Linux PC or laptop I recommend to use the following command: wget -c -b “http://file/you/wish/to/download.ext” –limit-rate=100k Where, -c will continue getting partially-downloaded file (if connection was dropped or smth else), -b will put wget downloading into background, –limit-rate=100k will limit downloading speed at 100 KBytes per second (KB/s). P.S. man […]

Read more →

 

Can’t find usable shell script encryption solution…

It sounds a bit cheesy but I can’t find any usable solution on how to encrypt Linux/Unix shell script in order to protect it’s source code when it’s still executable. There was a post here about how to protect shell scripts, but I found SHC bug. Just run script that is encrypted with shc and execute command ps ax and you’ll see full source code at ps‘s output (newline characters […]

Read more →

 

Quick shell change for user in Unix or Linux

In order to change shell for a particular user of Unix/Linux system without editing /etc/passwd file manually just use command: chsh -s /path/to/shell username for example, to change shell to ‘sh’ from ‘bash’ for user ‘viper’, use command: chsh -s /bin/sh viper

Read more →

 

Move linux to another hard drive (dump, restore, backup)

There are several methods to move running Linux to another hard drive at the same server. But I used Unix dump/restore utility to perform this… First of all it’s necessary to partition new hard drive in the same way as it’s done with old drive (Linux is running at). I usually use ‘fdisk’ utility. Let’s assume that old drive is /dev/hda and new one is /dev/hdb. To view hda’s partition […]

Read more →