dimanche 4 janvier 2015

restrict ssh access to /bin and using bash as a shell


I want to restrict my admin user to /bin directory while permitting to use bash as a shell via ssh. this is in my sshd_config file:



Match User admin
ChrootDirectory /bin
X11Forwarding no
ForceCommand scponly
#PermitTunnel no
AllowTcpForwarding no


in /etc/passwd:

admin:x:1001:100:,,,:/:/bash


when i use this command: ssh admin@192.168.1.20


this error appears: /bash: No such file or directory Connection to 192.168.200.242 closed.


if i change scponly to internal-sftp in sshd_config, all binary files exist (for example, bash) in / directory via sftp. why i can't use /bash as a shell after changing to scponly?


Can you help me?


Regards, siavash



Aucun commentaire:

Enregistrer un commentaire