Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Feb 182010
 

Put a profile in AppArmor complain mode

Answer:

Some applications, such as the MySQL server, if you changed the default datadir, you might not be able to startup MySQL.

To solve the problem, put the MySQL profile in AppArmor complain mode can solve the problem.

# sudo aa-complain /usr/sbin/mysqld

Then reload AppArmor

# sudo invoke-rc.d apparmor reload

Jan 312010
 

How to check failed login attempt in Ubuntu

Answer:

Every login attempts are logged in the file /var/log/auth.log in Ubuntu.

To check failed login attempt(s),

E.g.

# grep 'Failed password' /var/log/auth.log

Jan 31 14:00:27 localhost sshd[16141]: Failed password...
Jan 31 14:00:46 localhost sshd[16141]: Failed password...
Jan 31 14:00:49 localhost sshd[16141]: Failed password...
Jan 022010
 

How to generate random password?

Answer:

Install the "makepasswd" package, for example, in Ubuntu, type

sudo apt-get install makepasswd

Then execute command

# makepasswd 

ShdDHNt7z

Or you can use another tool called pwgen

sudo apt-get install pwgen

and execute

# pwgen 8 10

It will generate 10 passwords with length equal to 8