Category Archives: SSH

SFTP ONLY CHROOT


SFTPONLY
groupadd sftponly
useradd user2015
usermod -aG sftponly user2015
passwd user2015

vim /etc/ssh/sshd_config

Comment :

#Subsystem sftp /usr/libexec/openssh/sftp-server

Replace

Subsystem sftp internal-sftp

#Add di beris terakhir

Match Group sftponly
ChrootDirectory %h
ForceCommand internal-sftp
X11Forwarding no
AllowTcpForwarding no

sudo -u user2015 mkdir -pv /home/user2015/upload
chown root. /home/user2015
chmod 755 /home/user2015
chgrp -R sftponly /home/user2015

service sshd restart

#ACL
setfacl -R -m u:apache:rwx /home/user2015
setfacl -R -m g:apache:rwx /home/user2015

Troubleshoot SSH yang lambat antar host


Beberapa yang lalu teman saya ingin menjalankan backup data voice recording antar host menggunakan rsyn yang di integrasikan dengan openssh.  Size file recording yang akan di pindahkan 50 GB, ketika mengenerate ssh-keygent dan ingin memindahkan public_key (id_rsa.pub) ke server backup backup dengan menggunakan ssh-copy-id tetapi respose dari sisi server backup sangat lambat.

Berikut adalah tampilannya

[root@server212 .ssh]# ls -l
total 16
-rw——- 1 root root 1191 Oct  1 07:03 authorized_keys
-rw——- 1 root root 1671 Sep 21 02:31 id_rsa
-rw-r–r– 1 root root  396 Sep 21 02:31 id_rsa.pub
-rw-r–r– 1 root root 1588 Sep 23 08:19 known_hosts

[root@server212 .ssh]# ssh-copy-id -i id_rsa.pub root@203.86.xx.xx -v
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic

Cara untuk mengatasi case ini adalah dengan meng-edit /etc/ssh/sshd_config di sisi server backup (remote)

[root@server213 .ssh]# vim sshd_config

Sebelum

# GSSAPI options
GSSAPIAuthentication yes
#GSSAPIAuthentication no
GSSAPICleanupCredentials yes

Sesudah

# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication no
GSSAPICleanupCredentials no
#GSSAPICleanupCredentials yes

Restart service sshd

[root@server213 ssh]# /etc/init.d/sshd restart

Coba ssh ke remote server dan gunakan option -v (verbose) harusnya lebih cepat:)
Semoga bermanfaat


shisdew

Listens until think alike

moses.spaceku@yahoo.com / voip ipbx

Hosted PBX, IP-PBX SOHO/ CALL CENTER, VOICE GATEWAY, VOICE CARD, COST EFECTIVE SOLUTIONS (LCR), GSM/CDMA GATEWAY