Saturday 13 October 2012

How to configure sftp in rhel 6.3 / centos 6.3


How to Configure sftp

Note: sftp works in port number 115
[root@station1 ~]# cd /etc/vsftpd/
[root@station1 ~]# /usr/bin/openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout vsftpd.pem -out vsftpd.pem
[root@station1 ~]# vim /etc/vsftpd/vsftpd.conf
121 #For SSL
122 ssl_enable=YES
123 #To allow anonymous users to use SSL
124 allow_anon_ssl=YES
125 #local users to use both ssl and unsecure way
126 force_local_data_ssl=YES
127 #Force ssl
128 force_local_logins_ssl=YES
129 # Permit TLS v1 protocol connections. TLS v1 connections are preferred
130 ssl_tlsv1=YES
131 # Permit SSL v2 protocol connections. TLS v1 connections are preferred
132 ssl_sslv2=YES
133 # permit SSL v3 protocol connections. TLS v1 connections are preferred
134 ssl_sslv3=YES
135 #RSA certificate
136 rsa_cert_file=/etc/vsftpd/vsftpd.pem
[root@station1 ~]# service vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
[root@station1 ~]# ssh 10.65.62.35 --> loging in to client pc i.e station2
[root@station2 ~]# ftp ranjith@10.65.62.30 --- > Try, it wont login because we have kept force ssl

^C[root@station2 ~]#
[root@station2 ~]# sftp ranjith@10.65.62.30
Connecting to 10.65.62.30...
ranjith@10.65.62.30's password:
sftp> ls
Desktop Documents Downloads Music Pictures Public Templates Videos
sftp> bye
[root@station2 ~]#

1 comment:

  1. What u did is ftp on ssl, not sftp, do it as chroot jail

    ReplyDelete