Membuat login SFTP tanpa akses SSH pada CentOS/RHEL 6

| 21 September 2015 | 0 Comments


Instalasi OS (CentOS/RHEL) adalah minimalis

Update system
# yum -y update && yum -y upgrade

Ubah IP
# nano /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=xxxxxxxxxxxxxxxxx
TYPE=Ethernet
UUID=xxxxxxxxxxxxxxxxxxxxx
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=xxx.xxx.xxx.xxx
GATEWAY=xxx.xxx.xxx.1
NETMASK=255.255.255.0

Ganti DNS
# nano /etc/resolv.conf

nameserver 202.152.5.36
nameserver 202.152.1.73

Ubah HOSTNAME
# nano /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=xxxxxxxxx.kantor.co.id
GATEWAY=xxx.xxx.xxx.1

Ubah variable di APACHE
# nano /etc/ssh/sshd_config

Subsystem sftp internal-sftp
Match Group apache
ChrootDirectory /var/www/html
ForceCommand internal-sftp
AllowTCPForwarding no
X11Forwarding no

Restart APACHE
# service httpd restart

Matikan IPTABLES
# service iptables stop
# chkconfig iptables off

Matikan SELINUX
# nano /etc/selinux/config
selinux=disabled

atau
# setenforce 0

Aktifkan JAIL pada direktori homedirs
# setsebool -P ssh_chroot_rw_homedirs on

Aktifkan sFTPd pada direktori homedirs
# setsebool -P sftpd_enable_homedirs true

Buat user tetap di direktorinya
# restorecon -R /home/user/$USERNAME/files

Reboot server untuk mengaktifkan settingnya
# shutdown -r now



Tags: , , , , ,

Category: CentOS, Kerjaan, Unix

Leave a Reply

*