Putty Login As Sudo

WinSCP: SFTP Server mit sudo-Befehl ausführen

Putty Login As Sudo

Posted by Breland Albertina on Tuesday, 11 February, 2020 23:03:25

Ubuntu users typically take the ability to run the Sudo command for granted. That's because, during installation, a default user is created, and the default user in Ubuntu is always set up with Sudo permissions.If you are using other distributions or have other users within Ubuntu, however, the user likely needs to be granted permissions to run the Sudo command.

About Unix sudo and su commands. The Unix commands sudo and su allow access to other commands as a different user.. The sudo command. The sudo command allows you to run programs with the security privileges of another user (by default, as the superuser). It prompts you for your personal password and confirms your request to execute a command by checking a file, called sudoers, which the system

sudo su - UserB -c "ls -l /tmp"

What sudo does is grant you super-user privileges for the execution of the command. (You can think of it as "super-user do: command"). While I'm not familiar with using Putty, if you have managed to successfully login to the server you are targeting, you should be able to navigate to the "terminal" window and execute commands from there.

I use PuTTY to login to remote server. To reduce the manual work, I need to automate this task. I tried this code: start putty.exe -ssh -load session -l username -pw password -m command.txt -t The command.txt contains: sudo su - user1 ls cd directory Only the first command in command.txt is working and then PuTTY is expecting input from user.

sudo as another user with their environment. Ask Question Asked 4 years, 10 months ago. To invoke a login shell using sudo just use -i. When command is not specified you'll get a login shell prompt, otherwise you'll get the output of your command.