Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I would like to setup my profile in Windows Terminal in a way that it automatically connects to server1 via ssh and using server1 it connects to server2.
Everything works fine when i connect to single server1 machine but not sure how to launch second command.
What i have is:
in settings.json->"profiles"->"list" -
"commandline": "ssh -i "mykey.pem" ubuntu#server1"
What i want to do is something like (Bellow is just for visualization, any way that gets the job done is fine)
"commandline": "ssh -i "mykey.pem" ubuntu#server1 && ssh -i "mykey.pem" ubuntu#server2"
Found Solution thanks to https://unix.stackexchange.com/questions/41493/how-to-ssh-to-a-server-using-another-server
ssh -t $SERVER_A ssh $SERVER_B
gets the job done
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
i use ubuntu 20.04,using bash shell scripting i want to run the server in one terminal and open another terminal and run the client.I tried by using gnome-terminal it doesnt solve the problem.
#!/bin/bash
cd clustermanagement
go run server/main.go
gnome-terminal -x sh -c "go run client/main.go;bash"
i tried with other commands like gnome-terminal --bash -c "go run client/main.go; bash"
it didn't work.
the server starts running and then if press Ctrl+c and stop the server then only the client is running.
i want server to run and automatically a new terminal should be opened and client should run!
why not try running the server in the background using '&'
EDIT: looks like #Marc got to it first.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have an EC2 instance I"m trying to copy all the data inside of it into my drive.
the command
"scp -r / /users/seraph/targetdirectory"
does not work and returns
"no such file or directory"
On the OS X machine:
scp -r remotehost:/ /some/local/path
Better yet, use rsync so that you can support resume and deltas:
rsync -e ssh -avz remotehost:/ /some/local/path
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
My entirely new to MAC OS.
I am using MAC Terminal to connect to Linux servers (using SSH)
Is there a way to write a .command file to connect to the Linux servers, just by executing the .bat file from desktop?
Look at ssh client configuration and key-based authentication (man ssh and man ssh_config). You can configure all that so the command reduces to ssh hostname without writing any shellscript code. You can even assign a short name to a host.
For example (in ~/.ssh/config):
host abc
hostname remotehost.domain.tld
identityfile ~/.ssh/abc.dsa
user myuserid
Assuming you've generated and uploaded the corresponding public key, you can connect with the command
ssh abc
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I would like to put the password in on one line when running scp in my terminal
scp user1#xxx.xxx.x.5:sys_config /var/www/dev/
Thanks for your feed back got it to work I used the sshpass tool.
sshpass -p 'password' scp user1#xxx.xxx.x.5:sys_config /var/www/dev/
Using sshpass works best.
To just include your password in scp use the ' ':
scp user1:'password'#xxx.xxx.x.5:sys_config /var/www/dev/
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have problems in using nohup to run top command in the background. First, I run it locally, as
nohup top &
it complains in nohup.out with text top: failed to get tty. My ultimate goal is to run top on remote machine, like
nohup ssh -t user#hostname top &
currently, the above command also fails with
Pseudo-terminal will not be allocated because stdin is not a terminal.^M
TERM environment variable not set
Any ideas?
PS: I run this command to ping machineB from machineA. machineA is always alive, but not not always logged in.
Have you tried the -b (batch mode) switch of the top command?