Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 30 Server version: 10.1.48-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> select @@datadir; +-----------------+ | @@datadir | +-----------------+ | /var/lib/mysql/ | => 현재 설치 위치를 확인한다. +-----------------+ 1 row in set (0.00 sec)
$ ls -la /mariadb/data/mysql/ total 110660 drwxr-xr-x 5 mysql mysql 4096 Aug 29 00:10 . drwxr-xr-x 3 root root 4096 Aug 28 23:57 .. drwx------ 2 mysql mysql 4096 Aug 29 00:10 aaaa ==> 발견!! -rw-rw---- 1 mysql mysql 16384 Aug 28 23:56 aria_log.00000001 -rw-rw---- 1 mysql mysql 52 Aug 28 23:56 aria_log_control -rw-r--r-- 1 mysql mysql 0 Aug 28 23:46 debian-10.1.flag -rw-rw---- 1 mysql mysql 12582912 Aug 29 00:10 ibdata1 -rw-rw---- 1 mysql mysql 50331648 Aug 29 00:10 ib_logfile0 -rw-rw---- 1 mysql mysql 50331648 Aug 28 23:46 ib_logfile1 -rw-rw---- 1 mysql mysql 0 Aug 28 23:46 multi-master.info drwx------ 2 mysql mysql 4096 Aug 28 23:46 mysql -rw-rw---- 1 mysql mysql 15 Aug 28 23:46 mysql_upgrade_info drwx------ 2 mysql mysql 4096 Aug 28 23:46 performance_schema -rw-rw---- 1 mysql mysql 24576 Aug 29 00:10 tc.log ncloud@gov-mariadb:/$
다만, 설치하자마자 active 모드로 쓸수있어서 vsftpd 처럼 passive모드를 따로 설정안해줘도 되는 이점이 있다.
이것저것 다 귀찮으면 걍 SFTP를 쓰자 !!!!! 아래 내용을 잘 읽어주세요.
SFTP 설정 : 보안 이슈때문에 SSH 의 포트번호를 대부분 많이 바꾼다. : 여기서는 22번 기본 SSH 대신 20122를 쓴다고 가정해보자. ※ 주의할 점은 SSH PORT 와 SFTP PORT가 모두 동일할 거라고 생각하지만 실상 둘은 다르다. 즉, SSH의 PORT를 변경하게 되면 SFTP PORT또한 별도로 설정을 진행해야한다.
우선 서버에 ROOT 로 접속해서 아래 설정을 변경하자.
$ sudo vim /etc/ssh/sshd_config ....
쭉 ~ 열어 보면 아래 내용에서 Port를 바꿀 수 있다.
# The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options override the # default value.
Port 20122 => 요놈으 ssh Port이다 / 이놈이 원래는 22로 셋팅되어있을 것이다. 이걸 바꾸면 됨.
#AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress ::
~~~~~ 스크롤해서 아래로 더 내려가보자.
# override default of no subsystems Subsystem sftp /usr/lib/openssh/sftp-server
# Example of overriding settings on a per-user basis #Match User anoncvs Match LocalPort 20122 => 요놈이 sftp의 Port이다. / 이놈을 위에 포트와 동일하게 하면됨. 그럼 20122로 사용가능!! X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp