mudmanc4 Posted October 17, 2011 CID Share Posted October 17, 2011 I always change the ssh port on remote machines for obvious reasons, however it's causing an simple issue I hope someone can help with. Setting up a local server with rsnapshot using a cron and ssh keys, I need to change the command for ssh port remote access to upload the key. I just need the proper placement. I'm used to using -p to gain access , but not used it to upload a key until now. Tried " scp .ssh/is_rsa.pub -p xxxx [email protected]:.ssh/authorized_keys2 " " scp -p xxxx .ssh/id_rsa.pub [email protected]:.ssh/authorized_keys2 "[/code] I'll keep looking and post back when I get it is no one comes forward thanks Quote Link to comment Share on other sites More sharing options...
nanobot Posted October 17, 2011 CID Share Posted October 17, 2011 Try '-pXXXX' instead of a space between them. Thanks, EBrown Quote Link to comment Share on other sites More sharing options...
mudmanc4 Posted October 17, 2011 Author CID Share Posted October 17, 2011 Thanks , been there done that, I get " scp: illegal option -- 0 " , which can mean any number from a plethora of other issues. I'm certain there is a simple solution, Iv'e just got to apply myself mentally a little to this one and have a search. Quote Link to comment Share on other sites More sharing options...
sgbotsford Posted February 22, 2012 CID Share Posted February 22, 2012 The second form should work. Try adding a -v or -vv and see if the diagnostics reveal anything. The first two thoughts: You set the new port, but didn't restart the daemon. Or your fingers lead their own life and xxxx in your command is NOT the new port on your server. Check using something like nmap or hping to see that ssh is running on the port you want. If it's not, then scan to see if ssh is running on another port. A third possibility is that ssh is set up to refuse root access (this is the default.) Can you login with password? e.g. ssh -p xxxx [email protected] *** General note: Always have two ways to access a remote machine. Change only one at a time. Make sure that change survives a reboot. Now change the other one. mudmanc4 1 Quote Link to comment Share on other sites More sharing options...
Solution mudmanc4 Posted February 23, 2012 Author Solution CID Share Posted February 23, 2012 Thanks for your thoughts. I should have marked this solved. The correct way to do this would be to use capitol " -P " when specifying a port in this manner. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.