Permission to access another remote server Linux, Ubuntu [closed] - linux

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 4 years ago.
Improve this question
How can I allow a remote server to run a command without asking for password and any confirmation.
I use this command but it asks for password,
ssh root#0.0.0.0 /var/workingproject/notify
is there a way I can whitelist a remote server to access my server and execute a command without asking for password?

You can add your public key, generally found on your local box at ~/.ssh/id_rsa.pub to your remote server's authorized keys file. To do it automatically, you could use something like this:
ssh-copy-id -i ~/.ssh/id_rsa.pub root#0.0.0.0
Or alternatively, you can open the remote authorized keys file (~/.ssh/authorized_keys) and add your public key directly.
If you do not have a public key configured on your local instance, you can run:
ssh-keygen
to create one.

Related

Why can I do ssh to my server using any private key? [closed]

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 11 months ago.
Improve this question
I have Public key authentication enabled for connection to my server, after connecting to my server using my correct private key I can authenticate to my server using any private key file and it works.
I use -i option for specifying the private key:
ssh -i /anything meliwex#server_ip
Even if the file doesn't exist I can still connect to my server.
Is it possible that ssh caches the private key? If yes how can I remove that cache?
You could add -v to see which keys are really used.
The -i option isn't exclusive, ssh is still able to use keys from a ssh-agent and also the default keys from .ssh/id_*
Probably your key in .ssh/id_rsa isn't protected with a passphrase.
Therefore ssh will use it silently and you can login.

SSH Tunnel Issue [closed]

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 5 years ago.
Improve this question
I'm trying to tunnel to a remote VM.
I previously used the below command:
ssh -N -p 22 username#1.2.3.4 -o StrictHostKeyChecking=no -L 127.0.0.1:8080:5.6.7.8:443
Something went wrong with the server at the weekend and the SA had to restore the image.
Now when I try to do this I get prompted with the following:
Permission denied, please try again.
username#1.2.3.4's password:
I don't know what this password should be and the SA isn't available.
I am able to ssh directly onto 1.2.3.4 using my public key and when on it I can ssh onto 5.6.7.8 with this command:
ssh -A blueboxadmin#5.6.7.8
Is there any way I can use this to tunnel right through. Failing that, is there anything I can setup on 1.2.3.4 that will allow me to tunnel through?
Looks like the ssh key value pair is missing from the remote server.
You will have to copy the entry of you server ssh key (from $HOME/.ssh/id_rsa.pub file) into the remote server's $HOME/.ssh/authorized_keys file. Make sure the key is pasted in a single line. After doing this, you should be able to connect.

How to ssh another VM without password [closed]

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 6 years ago.
Improve this question
Now, I have two SuSe11SP3 VM. I want to ssh another VM without password. Because I often use scp to copy files between the two VMs. But the password is too long, I don't want to change password. I know maybe I can use publickey, my question is how can I achieve by using script.
As General said, you could use ssh-keygen to create a pair of keys without password and copy .pub key to another VM's ~/.ssh/authorized_keys

SSH to remote server [closed]

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 7 years ago.
Improve this question
this could be a very easy question, I have read some articles but I cannot fit those articles to my situation:
I have from remote.com server a pair of private and public keys (.ppk) for user 'dummy'.
I am in some Unix server (AIX 7.1) and I want to do:
ssh dummy#remote.server with prompt the login
We don't know the password they just provided the keys to log in into the server.
What we have to do?
Just in case: We don't have puttygen and We are not allowed to install it, do we have to ask for PEM format keys?
Making some assumptions:
That the people who have given you the public/private key pair have set up the remote server "dummy" account appropriately
The version of SSH on your local UNIX server is OpenSSH (or something similar)
You need to save the private key you have been given somewhere safe on the filesystem, but this needs to be in the format the local SSH client understands - and for this you will need to run it through 'puttygen'. Does not have to be on the local server, just somewhere to get the right format of key.
ssh -i <identity-file> dummy#<servername>
should do the trick.

How can I input password in advance with SSH? [closed]

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 often operat my remote vps.I write some script to simply my work.But every time after the line of ssh command,I have to input the password manually.How can I provide the password in the script and so that it will work on automatically,though I know it is not safe but my aim is just for convience.
I have tried many ways.
To be detailed,if I have a vps with the configuration as flows:
Protocol=SSH
Host=122.122.122.122
Port=22
UserName:root
Password:mypassword
I will write a script as flowers to connect the vps:
#!/bin/sh
ssh -p 22 root#122.122.122.122
#Other command flowers
Then I run the script.Before other command runs,I have to type the password.
root#122.122.122.122's password:
So I wonder if I have any solution to avoid typing password manually.
method 1:
first Create a new keypair:
ssh-keygen
Copy the public key to the server:
ssh-copy-id user#my.server.com
now server should recognize your key hence wont ask you for the password anymore:
ssh user#my.server.com
method 2:
use expect
#!/usr/bin/expect -f
spawn ssh user#my.server.com
expect "assword:"
send "mypassword\r"
interact

Resources