2008/02/27 18:57
ssh 은 사용 하지 않고 sftp 만 사용 하려고 할때 - rssh Linux2008/02/27 18:57
제목에서 처럼 sftp 만 사용 하려고 할 경우에 어떻게 해야 하는지에 대해 간략히 정리한다.
- 테스트 환경 : CentOS 5.1, openssh-server-4.3p2-24.el5
1. 패키지 다운로드 및 설치
# wget http://dag.wieers.com/rpm/packages/rssh/rssh-2.3.2-1.2.el5.rf.i386.rpm
# rpm -Uvh rssh-2.3.2-1.2.el5.rf.i386.rpm
2. 설치된 파일 리스트 보기
[root@centos5 ~]# rpm -ql rssh
/etc/rssh.conf (rssh 의 설정 파일)
/usr/bin/rssh (실행 파일)
/usr/libexec/rssh_chroot_helper
/usr/share/doc/rssh-2.3.2
/usr/share/doc/rssh-2.3.2/AUTHORS
/usr/share/doc/rssh-2.3.2/CHROOT
/usr/share/doc/rssh-2.3.2/COPYING
/usr/share/doc/rssh-2.3.2/ChangeLog
/usr/share/doc/rssh-2.3.2/NEWS
/usr/share/doc/rssh-2.3.2/README
/usr/share/doc/rssh-2.3.2/SECURITY
/usr/share/doc/rssh-2.3.2/TODO
/usr/share/man/man1/rssh.1.gz
/usr/share/man/man5/rssh.conf.5.gz
3. 사용자 쉘 변경
# usermod -s /usr/bin/rssh username
4. ssh / sftp 로 로그인 시도
[username@new21 ~]$ ssh rhel5
The authenticity of host 'rhel5 (192.168.1.240)' can't be established.
RSA key fingerprint is 82:33:6e:88:e4:3c:39:1f:73:89:c2:25:ba:16:39:e5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rhel5' (RSA) to the list of known hosts.
shsch@rhel5's password:
Last login: Wed Feb 27 18:50:03 2008 from 192.168.1.227
This account is restricted by rssh.
This user is locked out.
If you believe this is in error, please contact your system administrator.
Connection to rhel5 closed.
[
shsch@new21 ~]$ sftp rhel5
Connecting to rhel5...
shsch@rhel5's password:
Connection closed
위의 메세지 처럼 ssh, sftp 를 사용할 수가 없다.
5. sftp 사용할 수 있도록 설정 하기
아주 간단하게 /etc/rssh.conf 파일을 편집기로 열고 'allow sftp' 줄의 앞의 주석을 제거한다.
#allowscp
allowsftp
#allowcvs
#allowrdist
#allowrsync
다시 sftp 접속을 시도해 보면 정상적으로 연결이 될 것이다.
- 테스트 환경 : CentOS 5.1, openssh-server-4.3p2-24.el5
1. 패키지 다운로드 및 설치
# wget http://dag.wieers.com/rpm/packages/rssh/rssh-2.3.2-1.2.el5.rf.i386.rpm
# rpm -Uvh rssh-2.3.2-1.2.el5.rf.i386.rpm
2. 설치된 파일 리스트 보기
[root@centos5 ~]# rpm -ql rssh
/etc/rssh.conf (rssh 의 설정 파일)
/usr/bin/rssh (실행 파일)
/usr/libexec/rssh_chroot_helper
/usr/share/doc/rssh-2.3.2
/usr/share/doc/rssh-2.3.2/AUTHORS
/usr/share/doc/rssh-2.3.2/CHROOT
/usr/share/doc/rssh-2.3.2/COPYING
/usr/share/doc/rssh-2.3.2/ChangeLog
/usr/share/doc/rssh-2.3.2/NEWS
/usr/share/doc/rssh-2.3.2/README
/usr/share/doc/rssh-2.3.2/SECURITY
/usr/share/doc/rssh-2.3.2/TODO
/usr/share/man/man1/rssh.1.gz
/usr/share/man/man5/rssh.conf.5.gz
3. 사용자 쉘 변경
# usermod -s /usr/bin/rssh username
4. ssh / sftp 로 로그인 시도
[username@new21 ~]$ ssh rhel5
The authenticity of host 'rhel5 (192.168.1.240)' can't be established.
RSA key fingerprint is 82:33:6e:88:e4:3c:39:1f:73:89:c2:25:ba:16:39:e5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rhel5' (RSA) to the list of known hosts.
shsch@rhel5's password:
Last login: Wed Feb 27 18:50:03 2008 from 192.168.1.227
This account is restricted by rssh.
This user is locked out.
If you believe this is in error, please contact your system administrator.
Connection to rhel5 closed.
[
shsch@new21 ~]$ sftp rhel5
Connecting to rhel5...
shsch@rhel5's password:
Connection closed
위의 메세지 처럼 ssh, sftp 를 사용할 수가 없다.
5. sftp 사용할 수 있도록 설정 하기
아주 간단하게 /etc/rssh.conf 파일을 편집기로 열고 'allow sftp' 줄의 앞의 주석을 제거한다.
#allowscp
allowsftp
#allowcvs
#allowrdist
#allowrsync
다시 sftp 접속을 시도해 보면 정상적으로 연결이 될 것이다.
