How to configure SFTP in CENTOS


Configuration of SFTP in CentOS

[root@Karthick~]# cd /etc/vsftpd/
[root@Karthick~]# /usr/bin/openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout vsftpd.pem -out vsftpd.pem
[root@Karthick~]#[root@station1 ~]# vim /etc/vsftpd/vsftpd.conf
#For SSL
ssl_enable=YES
#To allow anonymous users to use SSL
allow_anon_ssl=YES
#local users to use both ssl and unsecure way
force_local_data_ssl=YES
#Force ssl
force_local_logins_ssl=YES
# Permit TLS v1 protocol connections. TLS v1 connections are preferred
ssl_tlsv1=YES
# Permit SSL v2 protocol connections. TLS v1 connections are preferred
ssl_sslv2=YES
# permit SSL v3 protocol connections. TLS v1 connections are preferred
ssl_sslv3=YES
#RSA certificate
rsa_cert_file=/etc/vsftpd/vsftpd.pem

[root@Karthick~]# service vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
[root@Karthick~]#sftp karthick@localhost
Connecting to localhost..
karthick@localhost password:
sftp> ls
Desktop Documents Downloads Music Pictures Public Templates Videos
sftp> bye
[root@Karthick~]#

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: