Script to remote login into server
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am using Ubuntu bash. I want to remote login to server through shell, it will give me its own command line. Then enter 'shell' followed by login credential again followed by a command. I need that command output printed on my screen. Please suggest, how do I do that?
shell login remote
add a comment |Â
up vote
0
down vote
favorite
I am using Ubuntu bash. I want to remote login to server through shell, it will give me its own command line. Then enter 'shell' followed by login credential again followed by a command. I need that command output printed on my screen. Please suggest, how do I do that?
shell login remote
4
I think you may be looking for thessh
command? To log into a remote machine you can do:ssh [user]@[hostname|ip address]
â Jesse_b
Dec 15 '17 at 14:50
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am using Ubuntu bash. I want to remote login to server through shell, it will give me its own command line. Then enter 'shell' followed by login credential again followed by a command. I need that command output printed on my screen. Please suggest, how do I do that?
shell login remote
I am using Ubuntu bash. I want to remote login to server through shell, it will give me its own command line. Then enter 'shell' followed by login credential again followed by a command. I need that command output printed on my screen. Please suggest, how do I do that?
shell login remote
edited Dec 15 '17 at 16:20
Stephen Rauch
3,248101227
3,248101227
asked Dec 15 '17 at 14:47
Viral Patel
1
1
4
I think you may be looking for thessh
command? To log into a remote machine you can do:ssh [user]@[hostname|ip address]
â Jesse_b
Dec 15 '17 at 14:50
add a comment |Â
4
I think you may be looking for thessh
command? To log into a remote machine you can do:ssh [user]@[hostname|ip address]
â Jesse_b
Dec 15 '17 at 14:50
4
4
I think you may be looking for the
ssh
command? To log into a remote machine you can do: ssh [user]@[hostname|ip address]
â Jesse_b
Dec 15 '17 at 14:50
I think you may be looking for the
ssh
command? To log into a remote machine you can do: ssh [user]@[hostname|ip address]
â Jesse_b
Dec 15 '17 at 14:50
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
ssh HOSTNAME "run_command with arguments"
will execute the command run_command and pass it two arguments - 1: "with" and 2: "arguments" ;-)
OUTPUT will go to stdout .. as usual
So if you want to check the files in a directory for evil stuff, for example:
#!/bin/bash
host=my-server.biz
check="/opt/path/to/check"
list=`ssh $host "ls $check"`
evil=`echo -e "$list"|grep -c "evil"`
if [ $evil -eq 0 ]; then
echo "all is well"
else
echo "the end is nigh"
fi
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
ssh HOSTNAME "run_command with arguments"
will execute the command run_command and pass it two arguments - 1: "with" and 2: "arguments" ;-)
OUTPUT will go to stdout .. as usual
So if you want to check the files in a directory for evil stuff, for example:
#!/bin/bash
host=my-server.biz
check="/opt/path/to/check"
list=`ssh $host "ls $check"`
evil=`echo -e "$list"|grep -c "evil"`
if [ $evil -eq 0 ]; then
echo "all is well"
else
echo "the end is nigh"
fi
add a comment |Â
up vote
1
down vote
ssh HOSTNAME "run_command with arguments"
will execute the command run_command and pass it two arguments - 1: "with" and 2: "arguments" ;-)
OUTPUT will go to stdout .. as usual
So if you want to check the files in a directory for evil stuff, for example:
#!/bin/bash
host=my-server.biz
check="/opt/path/to/check"
list=`ssh $host "ls $check"`
evil=`echo -e "$list"|grep -c "evil"`
if [ $evil -eq 0 ]; then
echo "all is well"
else
echo "the end is nigh"
fi
add a comment |Â
up vote
1
down vote
up vote
1
down vote
ssh HOSTNAME "run_command with arguments"
will execute the command run_command and pass it two arguments - 1: "with" and 2: "arguments" ;-)
OUTPUT will go to stdout .. as usual
So if you want to check the files in a directory for evil stuff, for example:
#!/bin/bash
host=my-server.biz
check="/opt/path/to/check"
list=`ssh $host "ls $check"`
evil=`echo -e "$list"|grep -c "evil"`
if [ $evil -eq 0 ]; then
echo "all is well"
else
echo "the end is nigh"
fi
ssh HOSTNAME "run_command with arguments"
will execute the command run_command and pass it two arguments - 1: "with" and 2: "arguments" ;-)
OUTPUT will go to stdout .. as usual
So if you want to check the files in a directory for evil stuff, for example:
#!/bin/bash
host=my-server.biz
check="/opt/path/to/check"
list=`ssh $host "ls $check"`
evil=`echo -e "$list"|grep -c "evil"`
if [ $evil -eq 0 ]; then
echo "all is well"
else
echo "the end is nigh"
fi
answered Dec 15 '17 at 16:05
flowtron
28616
28616
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f411072%2fscript-to-remote-login-into-server%23new-answer', 'question_page');
);
Post as a guest
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
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
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
4
I think you may be looking for the
ssh
command? To log into a remote machine you can do:ssh [user]@[hostname|ip address]
â Jesse_b
Dec 15 '17 at 14:50