Showing posts with label FreeBSD. Show all posts
Showing posts with label FreeBSD. Show all posts

Find text in folder

Type this command to find text or code in specific file in folder

#grep  -lr  "copyright"  *

The results are the list of files that contain text copyright in files.

SSH to Unix/Linux with another port number

Connect to OpenSSH Server with different port number

#ssh  user@hostname -p9999

SYNOPSIS
ssh [-l login_name ] hostname | user@hostname [command ]

ssh [-afgknqstvxACNTX1246 ] [-b bind_address ] [-c cipher_spec ] [-e escape_char ] [-i identity_file ] [-l login_name ] [-m mac_spec ] [-o option ] [-p port ] [-F configfile ] [-L port host hostport ] [-R port host hostport ] [-D port ] hostname | user@hostname [command ]

Example:

#ssh john@10.1.1.1  -p1234

Add apache2 password to protect files

Go to the folder that you want to add password protect

#htpasswd -c .htpasswd  username

#Enter the password <enter>

#Re-enter the password again <enter>

Unix command - Extract multiple files

Goto tar.gz folder

Type this command in terminal window:

#for a in 'ls  -1  *.tar.gz'; do tar -zxvf $a; done

FreeBSD 8.2 Apache22 Clean URL

Edit apache2 config file

# ee /usr/local/etc/apache22/httpd.conf

Change this line from

AllowOverride None
to 
AllowOveride All

Restart Apache2

# /usr/local/etc/rc.d/apache22 restart