I want to write a script to connect to the server, which will increase the privileges. Now I use a script with expect, but I would like to change that. Here is a way by which I try to achieve this:ssh host -t 'echo passowrd | sudo -S echo; sudo -i'Is the password is saved in the command history on server? I can't find any records of these commands:ssh host -t 'ls;echo $SHELL;history;bash -l'This command displays the result of the ls command and /bin/bash.
Sudo -i with password inside ssh
shell;ssh;sudo;password
use the sudoers (visudo or put a config to /etc/sudoers.d) to provide privileges for the user to execute given commands without password seems to be the better way.if you use not the interactive way (just remote execute and not login) there will be no entry made in bash history.To access the history of bash you need to use this for example:       ssh host cat .bash_historyBut you will not find any entries from a remote execution.