Scp, MySQL remote, Port, Ufw, Password - JeongtaekLim/TIL GitHub Wiki

Contents

  • Linux - remote file copy
  • MySQL - remote access
  • Port management - ping to specific port
  • Ufw - basic firewall for ubuntu linux
  • Linux - password

Linux - remote file copy

  • If you want to copy files from local to remote
$ scp -r [source] [dest]
$ scp -r ./somedirectory [email protected]:~/test

MySQL - remote access

  • If you want to access MySQL at remote,
$ mysql -u root -p
$ CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
$ GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
$ CREATE USER 'username'@'%' IDENTIFIED BY 'password';
$ GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
$ FLUSH PRIVILEGES;

Port management - ping to specific port

$ telnet 127.0.0.1 3306

Ufw - basic firewall for ubuntu linux

  • Port status
$ sudo ufw status verbose
  • Allow port There are some cases - only TCP, only UDP, both
$ sudo ufw allow 3306 (TCP + UDP)
$ sudo ufw allow 3306/TCP ( Only TCP )

Linux - password

If you want to change your password for Linux(Ubuntu), just type

$ passwd