Rssh

De MochilaWiki
Ir para navegaçãoIr para pesquisar

instalando

apt-get install rssh ssh openssh-server

configurando rssh

mv /etc/rssh.conf /etc/rssh.conf.old
echo "logfacility = LOG_USER" > /etc/rssh.conf
echo "allowsftp" >> /etc/rssh.conf
echo "umask = 066" >> /etc/rssh.conf
echo "chrootpath = /home/sftp" >> /etc/rssh.conf

criando jaula

cd /usr/share/doc/rssh/examples
sh mkchroot.sh /home/sftp

criando home e usuário

useradd -m -d /home/sftp/stevebiko.info -s /usr/bin/rssh bantu
chown root: /home/sftp/stevebiko.info
cd /home/sftp/stevebiko.info
mkdir tmp log public_html
chown bantu: tmp log public_html
passwd bantu

ajuste no servidor ssh

no arquivo /etc/ssh/sshd_config

  • Port 22 para Port 200
  • PermitRootLogin yes para PermitRootLogin no
  • X11Forwarding yes para X11Forwarding no
  • Subsystem sftp /usr/lib/openssh/sftp-server para Subsystem sftp internal-sftp

acrescente no final do arquivo

Match User bantu
   ChrootDirectory /home/sftp/stevebiko.info
   AllowTCPForwarding no
   X11Forwarding no
   PasswordAuthentication yes
   ForceCommand internal-sftp

reinicie o servidor ssh

/etc/init.d/ssh restart

acessando a conta SFTP

sftp -oPort=200 bantu@stevevebiko.info