A note on securing users password using hash on mysql
Login inside mysql shell
once login, issue the command
select password('internet');
assuming internet is the clear password
result below for the command:
mysql> select password('internet');
+-------------------------------------------+
| password('internet') |
+-------------------------------------------+
| *797420C584EBF42750EB523104268BA0FD87FBC8 |
+-------------------------------------------+
1 row in set (0.00 sec)
*797420C584EBF42750EB523104268BA0FD87FBC8 secure password that can be use
upon granting DB rights.
mysql> grant select,insert,update on dummy-db.* to 'testuser'@'%.%.%.%' identified by password '*797420C584EBF42750EB523104268BA0FD87FBC8';
Query OK, 0 rows affected (0.00 sec)
Query above will encrypt the defined password of user testuser on access to dummy-db and able to access from any remote ip. If you verify by using the mysql DB and select * from user;
| %.%.%.% | testuser | *797420C584EBF42750EB523104268BA0FD87FBC8 |
the cleartext password would be "internet".
Cisco | Linux | Mandriva | Centos | FreeBSD | GNS3 | Windows 2003 | RedHat | LVM | Rhev 3
Friday, April 19, 2013
Friday, April 5, 2013
Using proxy on yum and wget
1. do the command "export http_proxy=xxx.xxx.xxx.xxx:yyyy" assuming that you will be using ip address as your proxy and you are login as user or root, the proxy will be exported on your environment.
example:
export http_proxy=192.168.1.1:8080
2. for directly set the proxy at yum configuration. Append the line
proxy=http://192.168.1.1:8080
at /etc/yum.conf
that way, proxy is directly set at yum
thanks to those document found when googling. this is just my reference.
example:
export http_proxy=192.168.1.1:8080
2. for directly set the proxy at yum configuration. Append the line
proxy=http://192.168.1.1:8080
at /etc/yum.conf
that way, proxy is directly set at yum
thanks to those document found when googling. this is just my reference.
Wednesday, March 6, 2013
Dump Certain table from postgresql Server-A to postgresql Server-B
Problem:
Need to Dump Table user_data_login and restore it at Server-B from Server-A
DataBase Name: users_DB
User: postgres
At Server A
as postgres user
pg_dump --table=user_data_login users_DB -f /tmp/users_data.sql
At Server B
assuming that the users_DB.sql has been copied at /tmp/users_data.sql
execute the command below as postgres user
Problem:
Need to Dump Table user_data_login and restore it at Server-B from Server-A
DataBase Name: users_DB
User: postgres
At Server A
as postgres user
pg_dump --table=user_data_login users_DB -f /tmp/users_data.sql
At Server B
assuming that the users_DB.sql has been copied at /tmp/users_data.sql
execute the command below as postgres user
psql -d users_DB -f /tmp/users_data.sql
that's it.
Friday, January 18, 2013
grant readonly access on selected table - Postgres 8.4
Task: To grant select only on tables inside database MYDB01 under schema warehouse_data to user READONLY
On postgres 8.x, Im not sure if its my problem only, but I cannot do one grant command on all tables, so searching the web and found that it can be done this way.
for i in `bin/psql MYDB01-A -t -c "SELECT table_name FROM information_schema.tables WHERE table_schema = 'warehouse_data';"`; do bin/psql ces_live_final -c "GRANT SELECT ON warehouse_data.$i TO READONLY;"; done
The above is one line only, and it solves my task.
On postgres 8.x, Im not sure if its my problem only, but I cannot do one grant command on all tables, so searching the web and found that it can be done this way.
for i in `bin/psql MYDB01-A -t -c "SELECT table_name FROM information_schema.tables WHERE table_schema = 'warehouse_data';"`; do bin/psql ces_live_final -c "GRANT SELECT ON warehouse_data.$i TO READONLY;"; done
The above is one line only, and it solves my task.
Wednesday, December 19, 2012
Creating a startup script on Fedora 17 - Gnome-shell
- open at your terminal
gnome-session-properties
then you can add here your created application or script to run when you login on your gnome-shell.
gnome-session-properties
then you can add here your created application or script to run when you login on your gnome-shell.
Monday, October 22, 2012
Delete none functioning iscsi target
Delete none functioning iscsi target
Command:
If possible, shutdown those services that usually using the partition mounted via iscsi.
#Logoff iscsi - command below:
iscsiadm -m node -u
#Delete the target - assuming target is 192.168.1.6
iscsiadm -m node -p 192.198.1.6 --op=delete
#Login Iscsi
iscsiadm -m node -l
Tuesday, October 9, 2012
SELinux REMINDERS
I set a Linux WEB with remote mysql server that I need to enable SELinux for PCI Requirement.
created a separate Document ROOT for the web files.
/web/files
#Command below will set the context and becomes accessible via web
semanage fcontext -a -f "" -t httpd_sys_content_t '/web/files(/.*)?'
restorecon -RFvv /web/files
#Allow HTTPD scripts and modules to connect to the network using TCP.
setsebool -P httpd_can_network_connect 1
#Allow HTTPD scripts and modules to connect to databases over the network.
setsebool -P httpd_can_network_connect_db 1
created a separate Document ROOT for the web files.
/web/files
#Command below will set the context and becomes accessible via web
semanage fcontext -a -f "" -t httpd_sys_content_t '/web/files(/.*)?'
restorecon -RFvv /web/files
#Allow HTTPD scripts and modules to connect to the network using TCP.
setsebool -P httpd_can_network_connect 1
#Allow HTTPD scripts and modules to connect to databases over the network.
setsebool -P httpd_can_network_connect_db 1
Subscribe to:
Posts (Atom)