I am connecting to a server via PuTTY as follows:

```
putty.exe -ssh user@host -pw password -noagent -m commands.txt

```

After that I have to use:

```
su someUser

```

It will ask for a password - I have put this inside command.txt but it's not working.

How can I automate the su command (including password) in a single line that I can place inside command.txt? Or perhaps there is a different approach?

I don't want to use sudo or execute and all. I tried with:

```
echo password | su someUser

```

However piping in this way did not work.