Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support of running remote commands just like ssh -t or sftp -b #161

Closed
davxiao opened this issue Feb 16, 2019 · 2 comments
Closed

support of running remote commands just like ssh -t or sftp -b #161

davxiao opened this issue Feb 16, 2019 · 2 comments

Comments

@davxiao
Copy link

davxiao commented Feb 16, 2019

I need to run some commands on remote host right after authenticating. The use case is, first I was authenticated as UserA who is a sudoer on remote host, then I run sudo su - UserB to become UserB, since UserA is a sudoer, running sudo does not require password. Once I became UserB, sshfs can mount /home/UserB successfully.

I wonder if above scenario is possible with sshfs.

The following two existing commands do something similar to what I wanted on sshfs:
ssh -t UserA@remote-host "sudo su - UserB"
or
sftp -b batch-file-which-run-sudo UserA@remote-host

@yanir3
Copy link

yanir3 commented Feb 21, 2019

You can't do that because sftp does not have a sudo command. That example you've given with sftp -b will fail. Why not authenticate as UserB in the first-place?

@Nikratio
Copy link
Contributor

yanir3 is right, this is fundamentally impossible. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants