parsed.org

Tips by tag: permissions

To create a Postgres user sam and a database samdb that is owned by the sam user:

$ su - postgres
$ createuser -P -A -D sam
$ createdb -O sam samdb

(Change the -A, and -D options to affect the new user's abilities.)

Edit the user's password with:

template1=# alter user username_here with password 'password_here';
accountcommandscreatedbcreateuserpermissionspostgresqluser
Display files by size by http://felicity.me.uk/ on Apr 28, 2008 02:08 PM

For example, to display the 20 largest files owned by joe:

find / -printf "%k\t%p\n" -user joe | sort -n | tail -20
commandsfilesfindpermissionsprintfsorttailusers

To create a new database:

$ mysqladmin create <database_name>

To grant permissions to a user, run this:

$ mysql -u root -p
Password: (enter password)
mysql> GRANT ALL ON db_name.* TO username@localhost IDENTIFIED BY "userpasswd";

To flush the privilege tables, run this:

$ mysqladmin flush-privileges

or:

mysql> flush privileges;

To revoke the privileges from a particular user/host pair:

mysql> revoke all privileges, grant option from username;
commandsgotchamysqlmysqladminpermissionsrevokesql
Network Forensics by cygnus on Jan 21, 2005 08:31 AM

You can use the lsof (LiSt Open Files) utility to view information about which processes own file handles on a system. Since sockets map to file descriptors, lsof will show you which processes own socket connections. If you see that your machine is connected to another on TCP port 6234 (source or dest) and you want to find out which process(es) are responsible for the connection, run:

# lsof -ni tcp:6234

Note that when run as an unprivileged user, lsof will only show you file descriptors that you have permission to see. You must run lsof as root to see everything in the kernel.

commandsconnectionsdebuggingdescriptorsfilesystemlsofmonitoringnetworkpermissionsprocesssocketsutilities
RSS