Author:
erics, March 16th, 2022
Had an old server, needed to get root.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
service mysql stop ~OR~ service mysqld stop cd /etc/init.d; ./mysql<tab> start --skip-grant-tables mysql> update mysql.user set Password=PASSWORD('secret') where user='root'; mysql> flush privileges; mysql> ^D service mysql stop service mysql start ~OR~ service mysqld stop service mysqld start |
For MySQL 5.7: https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html For some other v5.7 nodes, I had admin access via a different user’s login, so all I needed was this:
|
ALTER USER 'root'@'localhost' IDENTIFIED BY 'secret'; ALTER USER 'root'@'%' IDENTIFIED BY 'secret'; |
Categories: How-To's, Technology Tags: 5.5, Flush, Grant, init.d, Lost, mysql, MySQL 5.5, Password, privileges, recover, Recovery, Reset, root, service, Skip, skip-grant-tables, Tables, User
|
No comments
Author:
erics, October 24th, 2019
All credit to Matt Wilcox for this excellent article, for which this post is based – thank you, Matt! https://mattwilcox.net/web-development/unexpected-ddos-blocking-china-with-ipset-and-iptables/ All commands run as root!
|
yum install -y ipset vi blockchina (see below for contents) chmod 755 blockchina ./blockchina |
Do this once only:
|
iptables -A INPUT -p tcp -m set --match-set china src -j DROP; service iptables save |
Then add blockchina to the root cron
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#!/bin/sh # # blockchina # DIR=/etc # Create the ipset list ipset -N china hash:net # remove any old list that might exist from previous runs of this script rm $DIR/cn.zone # Pull the latest IP set for China wget -P $DIR http://www.ipdeny.com/ipblocks/data/countries/cn.zone # Add each IP address from the downloaded list into the ipset 'china' for i in $(cat $DIR/cn.zone ); do ipset -A china $i; done # Update iptables service iptables restart |
Categories: How-To's, Technology Tags: Amazon, Amazon Linux, AWS, Block, China, DDOS, dos, Firewall, ipset, IPTables, Linux, root, traffic
|
No comments
Author:
erics, November 28th, 2017
Launch System Preferences Select Users & Groups Select Login Options Select Join next to Network Account Server Select Open Directory Utility Click the lock and enter your password to make changes In the menu bar of Directory Utility, select Change Root Password Create a strong, unique password
Categories: How-To's, Technology Tags: apple, Change, change password, Directory Utility, High Sierra, MacOS, Password, root, Sierra, System Preferences
|
No comments
Author:
erics, December 31st, 2013
update mysql.user set password=PASSWORD(‘Your New Password Here’) where user=’root’;
Categories: How-To's, Technology Tags: howto, mysql, Password, Reset, root, tips
|
No comments
Author:
erics, October 7th, 2013
sysctl -p /etc/sysctl.conf
Categories: How-To's, Technology Tags: /etc/sysctl.conf, howto, Linux, root, sudo, sysctl, tips, Ubuntu
|
No comments
Author:
erics, October 26th, 2011
Using mysqladmin on the command line If you have never set a root password for MySQL server, the server does not require a password at all for connecting as root.
To set the root password for the first time, use mysqladmin:
|
$ mysqladmin -u root password 'NewPasswordHere' |
However, if you want to change (or update) a root password, then […]
Categories: How-To's, Technology Tags: change password, cli, Command line, howto, mysql, mysqladmin, Password, root, tips
|
No comments
Author:
erics, August 14th, 2011
In the Terminal application, type the following: sudo /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder Then, click on an empty spot on your desktop – NOT in an existing Finder window. Now, type Command-N or select New Finder Window from the File menu. To end your root Finder session, type ^C in the Terminal window. Notes: You won’t be able to […]
Categories: How-To's, Technology Tags: Finder, howto, Leopard, macosx, root, Snow Leopard, Terminal, tips
|
No comments
Author:
erics, August 3rd, 2011
First use SSH to login as the ec2-user:
|
ssh -i AWSKeyPair.pem ec2-user@{NewHostName} % sudo su - # |
erics@zeus:/Users/erics # ssh -i foo.pem ec2-user@thehost.foo Last login: Tue Nov 19 20:28:19 2013 from foo.bar __| __|_ ) _| ( / Amazon Linux AMI ___|\___|___| https://aws.amazon.com/amazon-linux-ami/2013.09-release-notes/ No packages needed for security; 7 packages available Run “sudo yum update” to apply all updates. [ec2-user@xyz ~]$ sudo su […]
Categories: How-To's, Technology Tags: .pem, AWS, AWSKeyPair, AWSKeyPair.pem, howto, Instance, key, KeyPair, Launch, root, ssh, su, sudo, tips
|
No comments
Author:
erics, September 8th, 2010
In Terminal, execute the following: [code]sudo password root[/code]
Categories: How-To's, Technology Tags: 10.5, 10.5.x, Leopard, macosx, passwd, Password, root
|
No comments