Sunday, September 28, 2008

Change SA password

Exec Sp_Password NULL, 'new_password', 'sa'

Using PKI with SSH

If you're concerned about the global increase in brute-force SSH login attempts, you can use PKI to prohibit successful unauthorized authentication through password guessing.

Generate key pair
# keygen -b 1024 -t rsa -f ./rsa_id_clientname

Add/append public key to ~/.ssh/authorized_keys file on the target

Add/append a few lines to ~/.ssh/config on the client
Host
User
IdentityFile ~/.ssh/

Attempt new SSH session

Saturday, September 13, 2008

Troubleshooting MS SQL Server

/* DO NOT JUST EXECUTE THIS SCRIPT. HIGHLIGHT THE COMMAND AND RUN IT */

select @@servername
/* returns name of server. */

select @@version
/* returns the version. */

select @@connections
/* returns number of connections since restarted. */

select @@packet_errors
/* returns number of packet errors since restarted. */

select dbid, DB_NAME(dbid) AS DB_NAME FROM sysdatabases
/* Returns the database name. */

sp_tables
/* Returns a list of objects (table names) that can be queried in the current environment (any object that can appear in a FROM clause). */

sp_helplogins
/*Provides information about logins and the associated users in each database */