Topic "Change: Removed One file only editing mode in 8.1"

Author Message
magix

Guest


I'm using this feature in 8.0 and it's very sad that it was removed in future versions.
Why I need it:
1. I connect to the sunOs server via scp with "bash -c 'sudo su - username'";
2. winScp do not pick up the PATH settings in .profile of username, I have a workaround for that - setting the PATH manually thru terminal(Ctrl+T).
3. When I edit the file it opens in new session(since 8.1) and PATH is not set, that's why it's not possible to save the changes.
Could you, please, advice any workaround for this situation?
Advertisements
magix

Guest


magix wrote:
I'm using this feature in 8.0 and it's very sad that it was removed in future versions.
Why I need it:
1. I connect to the sunOs server via scp with "bash -c 'sudo su - username'";
2. winScp do not pick up the PATH settings in .profile of username, I have a workaround for that - setting the PATH manually thru terminal(Ctrl+T).
3. When I edit the file it opens in new session(since 8.1) and PATH is not set, that's why it's not possible to save the changes.
Could you, please, advice any workaround for this situation?

Or how to login(using "bash -c 'sudo su - username'") with PATH initialized?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24554
Location: Prague, Czechia
I cannot test it now, but it may help if you move your settings from .profile to .bashrc. Or try to invoke bash a login shell (using --login switch I believe).
_________________
Martin Prikryl
magix

Guest


I have tried .bashrc - it's not read on start-up. .bashrc was in the home/username directory.
The same with --login switch - nothing is read from .profile, .bash-profile. Switch was used here: "bash -c 'sudo su - username' --login".
I have tried also "bash -c 'sudo su - username' --rcfile ./.bashrc" - no luck. Sad
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24554
Location: Prague, Czechia
magix wrote:
I have tried .bashrc - it's not read on start-up. .bashrc was in the home/username directory.
The same with --login switch - nothing is read from .profile, .bash-profile. Switch was used here: "bash -c 'sudo su - username' --login".
I have tried also "bash -c 'sudo su - username' --rcfile ./.bashrc" - no luck. Sad

In fact you should tweak the inner shell (the one run by su), not the outter one.
However according to su docs, the dash switch should cause su to execute the inner shell as login. But maybe your default shell (the one that su execute) is not a bash at all. Also I do not understand what is purpose of the 'bash -c' at all. You should be able to do sudo su - username only.
_________________
Martin Prikryl
Guest




Quote:
You should be able to do sudo su - username only.

Yes, you're right on that.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License