Remote ssh script execution with EOI or EOSSH adding dots in front of commands
Clash Royale CLAN TAG#URR8PPP
Here the first block was running, second block was not. And the problem was EOI considers spaces as dots, I think. But, it does not consider tab as dot. Making no indentation worked for me. But is there any way to specify not to consider tabs or spaces as dots?
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI
sudo rm -rf letsencrypt.tar.gz
sudo rm -rf /etc/letsencrypt
sudo rm -rf /usr/local/share/ca-certificates/chain.crt
sed -e 1b -e '$!d' $remote_home_dir/.bashrc
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get install certbot -y &
exit
trap exit INT
EOI
###############
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI
sudo certbot certonly -n --agree-tos --register-unsafely-without-email --standalone -d $FQDN
sudo chown -R root:sudo /etc/letsencrypt/
sudo chmod -R 750 /etc/letsencrypt/
sudo chmod -R 644 /usr/local/share/
sudo cp /etc/letsencrypt/live/$FQDN/chain.pem /usr/local/share/ca-certificates/chain.crt
sudo update-ca-certificates
sudo tar -czvf letsencrypt.tar.gz /etc/letsencrypt
exit
EOI
Updated
Now, the first part works, when it goes to second part begins at line ############### it says the following:
Command '.sudo' not found, did you mean:
command 'sudo' from deb sudo
command 'sudo' from deb sudo-ldap
Try: sudo apt install <deb name>
Someone shared a solution before but later removed it, I think that would work for me. :)
Why is it adding "." in front of all commands?
bash shell-script ssh terminal remote
add a comment |
Here the first block was running, second block was not. And the problem was EOI considers spaces as dots, I think. But, it does not consider tab as dot. Making no indentation worked for me. But is there any way to specify not to consider tabs or spaces as dots?
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI
sudo rm -rf letsencrypt.tar.gz
sudo rm -rf /etc/letsencrypt
sudo rm -rf /usr/local/share/ca-certificates/chain.crt
sed -e 1b -e '$!d' $remote_home_dir/.bashrc
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get install certbot -y &
exit
trap exit INT
EOI
###############
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI
sudo certbot certonly -n --agree-tos --register-unsafely-without-email --standalone -d $FQDN
sudo chown -R root:sudo /etc/letsencrypt/
sudo chmod -R 750 /etc/letsencrypt/
sudo chmod -R 644 /usr/local/share/
sudo cp /etc/letsencrypt/live/$FQDN/chain.pem /usr/local/share/ca-certificates/chain.crt
sudo update-ca-certificates
sudo tar -czvf letsencrypt.tar.gz /etc/letsencrypt
exit
EOI
Updated
Now, the first part works, when it goes to second part begins at line ############### it says the following:
Command '.sudo' not found, did you mean:
command 'sudo' from deb sudo
command 'sudo' from deb sudo-ldap
Try: sudo apt install <deb name>
Someone shared a solution before but later removed it, I think that would work for me. :)
Why is it adding "." in front of all commands?
bash shell-script ssh terminal remote
Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846
– Haxiel
Mar 1 at 10:58
Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.
– Rakib Fiha
Mar 1 at 15:38
Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)
– Haxiel
Mar 1 at 16:15
add a comment |
Here the first block was running, second block was not. And the problem was EOI considers spaces as dots, I think. But, it does not consider tab as dot. Making no indentation worked for me. But is there any way to specify not to consider tabs or spaces as dots?
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI
sudo rm -rf letsencrypt.tar.gz
sudo rm -rf /etc/letsencrypt
sudo rm -rf /usr/local/share/ca-certificates/chain.crt
sed -e 1b -e '$!d' $remote_home_dir/.bashrc
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get install certbot -y &
exit
trap exit INT
EOI
###############
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI
sudo certbot certonly -n --agree-tos --register-unsafely-without-email --standalone -d $FQDN
sudo chown -R root:sudo /etc/letsencrypt/
sudo chmod -R 750 /etc/letsencrypt/
sudo chmod -R 644 /usr/local/share/
sudo cp /etc/letsencrypt/live/$FQDN/chain.pem /usr/local/share/ca-certificates/chain.crt
sudo update-ca-certificates
sudo tar -czvf letsencrypt.tar.gz /etc/letsencrypt
exit
EOI
Updated
Now, the first part works, when it goes to second part begins at line ############### it says the following:
Command '.sudo' not found, did you mean:
command 'sudo' from deb sudo
command 'sudo' from deb sudo-ldap
Try: sudo apt install <deb name>
Someone shared a solution before but later removed it, I think that would work for me. :)
Why is it adding "." in front of all commands?
bash shell-script ssh terminal remote
Here the first block was running, second block was not. And the problem was EOI considers spaces as dots, I think. But, it does not consider tab as dot. Making no indentation worked for me. But is there any way to specify not to consider tabs or spaces as dots?
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI
sudo rm -rf letsencrypt.tar.gz
sudo rm -rf /etc/letsencrypt
sudo rm -rf /usr/local/share/ca-certificates/chain.crt
sed -e 1b -e '$!d' $remote_home_dir/.bashrc
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get install certbot -y &
exit
trap exit INT
EOI
###############
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI
sudo certbot certonly -n --agree-tos --register-unsafely-without-email --standalone -d $FQDN
sudo chown -R root:sudo /etc/letsencrypt/
sudo chmod -R 750 /etc/letsencrypt/
sudo chmod -R 644 /usr/local/share/
sudo cp /etc/letsencrypt/live/$FQDN/chain.pem /usr/local/share/ca-certificates/chain.crt
sudo update-ca-certificates
sudo tar -czvf letsencrypt.tar.gz /etc/letsencrypt
exit
EOI
Updated
Now, the first part works, when it goes to second part begins at line ############### it says the following:
Command '.sudo' not found, did you mean:
command 'sudo' from deb sudo
command 'sudo' from deb sudo-ldap
Try: sudo apt install <deb name>
Someone shared a solution before but later removed it, I think that would work for me. :)
Why is it adding "." in front of all commands?
bash shell-script ssh terminal remote
bash shell-script ssh terminal remote
edited Mar 1 at 10:22
Rakib Fiha
asked Feb 28 at 19:01
Rakib FihaRakib Fiha
218
218
Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846
– Haxiel
Mar 1 at 10:58
Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.
– Rakib Fiha
Mar 1 at 15:38
Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)
– Haxiel
Mar 1 at 16:15
add a comment |
Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846
– Haxiel
Mar 1 at 10:58
Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.
– Rakib Fiha
Mar 1 at 15:38
Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)
– Haxiel
Mar 1 at 16:15
Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846
– Haxiel
Mar 1 at 10:58
Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846
– Haxiel
Mar 1 at 10:58
Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.
– Rakib Fiha
Mar 1 at 15:38
Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.
– Rakib Fiha
Mar 1 at 15:38
Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)
– Haxiel
Mar 1 at 16:15
Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)
– Haxiel
Mar 1 at 16:15
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503620%2fremote-ssh-script-execution-with-eoi-or-eossh-adding-dots-in-front-of-commands%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503620%2fremote-ssh-script-execution-with-eoi-or-eossh-adding-dots-in-front-of-commands%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846
– Haxiel
Mar 1 at 10:58
Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.
– Rakib Fiha
Mar 1 at 15:38
Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)
– Haxiel
Mar 1 at 16:15