Allow user to use FTP command in SSH?
Hi everyone,
I have a client who has a bash script which performs some commands over FTP to another server that they use for SQL. The problem is that the sh script can't connect over FTP to the remote server:
I gave them SSH access and tried running the ftp command, and get the same output:
The ftp command works if I run it under root. How can I help them ? Is it ok if I add that script to the server's crontab file ? Wouldn't that be a security issue ? I trust this person, but if they get hacked I guess it may affect me as well. What could I do ? Thanks.
$ sh /home/XXX/tester_erpupd@XXX/checkupd/dbupdate/checkdbupd.sh
./getfile: line 10: ftp: command not found
I gave them SSH access and tried running the ftp command, and get the same output:
$ ftp
-bash: ftp: command not foundThe ftp command works if I run it under root. How can I help them ? Is it ok if I add that script to the server's crontab file ? Wouldn't that be a security issue ? I trust this person, but if they get hacked I guess it may affect me as well. What could I do ? Thanks.
-
Where does "whereis ftp" tell you it's located? That might go a ways towards identifying your problem. You may need to run that command as root. 0 -
It's a standard Cpanel + Cloudlinux installation, so: # whereis ftp ftp: /usr/bin/ftp /usr/share/man/man1/ftp.1.gz0 -
I can't reproduce your issue. As a non-root user, I can hit FTP from the command line. $ ftp ftp> exit Jailshell is enabled, so I don't think that's the source of your problem if you're doing the same. Could be the user's $path variable's messed up. Can you create another user to test with? 0 -
I've tried this on CloudLinux with the user in Jailshell and caged by CageFS with no issues - I'd lean more toward @quanin's suggestion being correct, there is something non-standard about the configuration that would cause this not to function. 0
Please sign in to leave a comment.
Comments
4 comments