Model

 Raspberry PI B+

 OS

 RASPBIAN 3.12

문제점

라즈베리파이에 FTP 서버를 구축하고 사용한다.

해결 방안

1. 라즈베이파이에 vsftpd를 설치한다.

sudo apt-get install vsftpd

2. 설정파일을 자신에 맞게 변경한다.

sudo vi /etc/vsftpd.conf

vsftpd_setting.txt

개인적으로 변경한 부분.
'anonymous_enable = YES' 이 부분 찾아서 주석 처리하고 아래 내용 추가
(아래 내용들은 파일에 다 주석처리되어있어서 찾아서 변경하는 것보다 그냥 넣어주는 것이 편하다.)

#anonymous_enable=YES

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022

#chroot_local_user=YES
#user_sub_token=$USER
#local_root=/home/$USER/ftp

force_dot_files=YES
anon_max_rate=0
local_max_rate=0
trans_chunk_size=0

dirmessage_enable=YES
xferlog_enable=YES

connect_from_port_20=YES
xferlog_std_format=YES

idle_session_timeout=600
data_connection_timeout=120

ftpd_banner=Welcome to MDSL FTP service.
listen=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
항목별 기능(추후 추가)
anonymous_enable : 익명사용자 접속 허용 여부

3. vsftpd 재시작

sudo service vsftpd restart

* 문제가 생길 때 vsftpd 제거후 다시 설치 방법

sudo apt-get remove --purge vsftpd
sudo apt-get install vsftpd

참고사이트 Link, LinkLink, Link, Link

$ ps -fu username UID PID PPID C STIME TTY TIME CMD username 17355 17353 0 18:06:49 pts/29 0:00 -csh username 17604 17355 0 18:15:25 pts/29 0:00 ps -fu username username 17353 17350 0 18:06:49 ? 0:00 /usr/lib/ssh/sshd


$ kill -9 PID

'System > Linux, unix' 카테고리의 다른 글

Linux OS 확인  (0) 2017.11.29
[UNIX]메시지 보내기 - talk, write, wall  (0) 2014.10.22
[ubuntu] ssh server 설치  (0) 2014.07.02
[ubuntu] JAVA JDK 설치하기  (0) 2014.04.06

채팅 : talk 사용자명

$ talk username

메시지 전달 : write 사용자명

$ write username
$ input message
ctrl + D 전송

접속한 모두에게 메시지 전달 : wall

$ wall
$ input message
ctrl + D 전송

메시지 수신, 허용/거부

거부
$ mesg n
허용
$ mesg y
확인
$ mesg


'System > Linux, unix' 카테고리의 다른 글

Linux OS 확인  (0) 2017.11.29
[UNIX] session 죽이기(kill)  (0) 2014.11.16
[ubuntu] ssh server 설치  (0) 2014.07.02
[ubuntu] JAVA JDK 설치하기  (0) 2014.04.06

유닉스에서 파일 목록 출력하기

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <dirent.h>
#include <error.h>
 
int main()
{
    DIR *dir;
    struct dirent *ent;
    dir = opendir ("./");
    if (dir != NULL) {
 
    /* print all the files and directories within directory */
    while ((ent = readdir (dir)) != NULL) {
        printf ("%s\n", ent->d_name);
    }
    closedir (dir);
    } else {
         /* could not open directory */
         perror ("");
        return EXIT_FAILURE;
    }
}


윈도우에서 파일 목록 출력하기

#include <stdio.h>
#include <io.h>
#include <conio.h>
 
void main()
{
    _finddata_t fd;
    long handle;
    int result = 1;
    handle = _findfirst(".\\*.*", &fd);  //현재 폴더 내 모든 파일을 찾는다.
 
    if (handle == -1)
    {
        printf("There were no files.\n");
        return;
    }
 
    while (result != -1)
    {
        printf("File: %s\n", fd.name);
        result = _findnext(handle, &fd);
    }
 
    _findclose(handle);
    return;
}

출처 링크, 링크


+ Recent posts