[SOLVED] sshd_config error Bad configuration option: PermitLocalCommand
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
sshd_config error Bad configuration option: PermitLocalCommand
Hi group,
I am having a problem with sshd_config. I am trying to implement PermitLocalCommand and LocalCommand. I have updated my config file with this:
Code:
PermitLocalCommand yes
LocalCommand /usr/local/bin/check_sftp_limit.php
Match Group vms
ChrootDirectory /home/vms
ForceCommand internal-sftp
But when I try to execute I get these error messages:
Code:
/usr/sbin/sshd -f /etc/ssh/vms_config
/etc/ssh/vms_config: line 29: Bad configuration option: PermitLocalCommand
/etc/ssh/vms_config: line 30: Bad configuration option: LocalCommand
/etc/ssh/vms_config: terminating, 2 bad configuration options
These options are in the man page as valid. It fails on my Fedora 13, raspbian ( Debian ) and with the latest source ( OpenSSH_6.0p1 Debian-3, OpenSSL 1.0.1c 10 May 2012 ).
Do I need to compile the source with some special option??
What were you looking for? Maybe there is another way to reach the results you intended.
What I need to do is limit the number of connection made by a SFTP user. I have tried many ways that don't completely work. I need a way to run a script when the user logs in. I have the script but I can't figure a way to call it other than tailing /var/log/messages for 'Accepted password for user'. Which will work but then there is the log rotate problem. I really don't want to modify SFTP.
You can run a script on successful login either in /etc/ssh/sshrc or in ~/.ssh/rc It can't be allowed to produce any output to stdout, though.
If you run sshd under xinetd instead of as a daemon, you can limit the number per ip address using per_source. It's not the same a limiting per user, but close. Maybe you could have the script check how many times the user is logged in already and drop the connection if the max is exceeded.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.