lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.11k stars 162 forks source link

Can't disable pseudo-tty for sftp get #451

Open devhen opened 6 years ago

devhen commented 6 years ago

I'm trying to disable pseudo-tty allocation by setting ssh -T so that I can run lftp through apache without having to get access to the tty which SELinux blocks. It doesn't seem to be working as I'm still getting this error:

get: Fatal error: pseudo-tty allocation failed: No such file or directory

when I try to disable pseudo-tty in ssh like this:

lftp -c 'set sftp:connect-program "ssh -a -x -T"; connect sftp://user:pass@site; get file.ext -o /tmp/file.ext; bye'

Any ideas?

Thanks!

kevcube commented 3 years ago

@devhen did you ever find a solution for this one? 😬

lavv17 commented 3 years ago

Lftp itself allocates a pseudo tty to interact with ssh. Currently there is no option to disable it.

On Tue, 25 May 2021 at 00:26, Kevin Mahoney @.***> wrote:

@devhen https://github.com/devhen did you ever find a solution for this one? 😬

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/issues/451#issuecomment-847347256, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHLWXAAALKEOKUJH65BXHTTPK77TANCNFSM4E73SS5Q .

-- Alexander.

NathanZookCH commented 10 months ago

This is actually a critical problem for lambdas in AWS, as the lambda user appears to lack the ability to create a pseudo-tty. Given what I'm doing (periodically mirroring a remote directory), I can switch over to an EC2 instance, but it will be significantly more clunky.

kevcube commented 10 months ago

This is actually a critical problem for lambdas in AWS, as the lambda user appears to lack the ability to create a pseudo-tty. Given what I'm doing (periodically mirroring a remote directory), I can switch over to an EC2 instance, but it will be significantly more clunky.

@NathanZookCH my solution was using a container runtime inside lambda.

NathanZookCH commented 10 months ago

This was with a container runtime.

On Fri, Jan 5, 2024 at 4:55 AM Kevin Mahoney @.***> wrote:

This is actually a critical problem for lambdas in AWS, as the lambda user appears to lack the ability to create a pseudo-tty. Given what I'm doing (periodically mirroring a remote directory), I can switch over to an EC2 instance, but it will be significantly more clunky.

@NathanZookCH https://github.com/NathanZookCH my solution was using a container runtime inside lambda.

— Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/issues/451#issuecomment-1878621453, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV5ISLCYKTKPDHPQEA77LWLYM7Z4RAVCNFSM4E73SS52U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBXHA3DEMJUGUZQ . You are receiving this because you were mentioned.Message ID: @.***>

scorpio1441 commented 9 months ago

This is related to the jailed environment. I just got it fixed by unjailing the user.

NathanZookCH commented 9 months ago

I ended up using the sftp command instead. I had to create the authorized_keys file (in a "safe" directory), and use a command file, but it works fine. No need to jailbreak.

scorpio1441 commented 9 months ago

The only problem that sftp doesn't support remote file deletion after successful transfer and requires interactive input. Doesn't work well on automated systems.