SSH networking

Tips and Tricks for Networking

Moderator: jkerr82508

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

SSH networking

Postby viking60 » 18 Feb 2014, 21:01

Image
I always struggle with Samba, basically the SSH protocol is way more secure anyway. So I use mostly ssh to communicate with network and remote computers.
Image

My problem is that I might have different usernames on those computers so I will have to remember

berserk@someserver.com and viking60@anotherserver.org etc. and they all might have different ports too.
I could use aliases of course but SSH has a config file that can gather all that information.

If you don't have it then create ~/.ssh/config and chmod it to 600 (not higher).

Now I want my box to understand that I always use viking60 as my username if nothing else is specified.And I want to specify servers with "special" settings.

I start with the specials and put the general info at the bottom - this is important!

Code: Select all

Host ss
Hostname someserver.com
Port 88995
User berserk


to log in to this server i can now simply type

Code: Select all

ssh ss

rather than:

Code: Select all

ssh berserk@someserver.com -p 88995


I also want to save the time of writing viking60@ on all the other servers so I want this to be preset too:

Code: Select all

Host *
User viking60


now I can simply write

Code: Select all

ssh anotherserver

By now my entire ~/.ssh/config looks like this:

Code: Select all

Host ss
Hostname someserver.com
Port 88995
User berserk

Host *
User viking60


I combine this with the password-less secure login (ssh encryption key):
:A
On my local PC I typed:
1.

Code: Select all

ssh-keygen

I entered a passphrase (you don't have to )

2. I typed (on my local PC):

Code: Select all

ssh-copy-id -i ~/.ssh/id_rsa.pub viking60-server

(That is where the magic happens and the key is moved to the viking60-server from my local PC)

3.I log in to the server from my local PC

Code: Select all

ssh viking60-server


You can't use this with Windows you say?
Yes you can! +1
:A
http://support.suso.com/supki/SSH_Tutorial_for_Windows
Basically you use Putty.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
Snorkasaurus
Berserk
Posts: 587
Joined: 30 Dec 2013, 19:19
Contact:

Re: SSH networking

Postby Snorkasaurus » 27 Feb 2014, 04:40

viking60 wrote:Basically you use Putty.
PuTTY and WinSCP are two of the bitchinest applications available for Windows. A couple of items I didn't see in the article are

1. There is a fork of PuTTY called KiTTY that includes serial support in case you happen to be one of those suckers... I mean "lucky admins" who gets to manage switches & routers that are inherited from admins who don't document passwords. :-)
2. WinSCP has an extensive scripting feature that can be used to automate a plethora of tasks including scheduled backups to a remote location.

My 3¢
S.

Blackcrack
Posts: 300
Joined: 02 Apr 2013, 08:31

Re: SSH networking

Postby Blackcrack » 27 Feb 2014, 08:02

Hi,

try out
http://smartty.sysprogs.com/
http://smartty.sysprogs.com/download/
the portable one.. this is the best for use it win WinNt like Reactos.org, Win7
and supports in openmandriva the ssh X-redirect for starting drakconf and other X-Programms.

with "su -" become you the root with original-variables from root (like local login),
with only "su" have you the possible for execute root-command/orders
but more better it is to have an fully root-variable as root

the same can you use with an user "su - %user%"

best regards
Blacky

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: SSH networking

Postby viking60 » 27 Feb 2014, 12:11

Yes two good alternatives there. Putty is no holy grail - only the best known.
They both look very good and they can both handle SSH.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

Blackcrack
Posts: 300
Joined: 02 Apr 2013, 08:31

Re: SSH networking

Postby Blackcrack » 27 Feb 2014, 13:36

hummm, kitty and putty can not x redirect, smartty can it already ..

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: SSH networking

Postby viking60 » 27 Feb 2014, 18:21

Tested smarty
Image

I used the portable version and I was logged in in "no time" so it seems good.
The X bit did only pop a lot of windows without working - almost like a virus so that part was not to peachy (probably fixable but still)
Checking out Kitty now.....

And no problems with kitty portable either it logs in there fast. Both do the job.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
Snorkasaurus
Berserk
Posts: 587
Joined: 30 Dec 2013, 19:19
Contact:

Re: SSH networking

Postby Snorkasaurus » 27 Feb 2014, 18:39

Blackcrack wrote:hummm, kitty and putty can not x redirect, smartty can it already ..

Hey Blackcrack,
When you setup your connection, click on X11 in the left pane (under ssh) to setup x redir in putty.
S.

Blackcrack
Posts: 300
Joined: 02 Apr 2013, 08:31

Re: SSH networking

Postby Blackcrack » 27 Feb 2014, 19:10

oh oh ohhkeeyyy :) thank's, did not look directly on it..
but now, nice.. thank you :)
edit: humm.. is an installable xserver and not portable ... smartty is portable ..

best regards
Blacky

User avatar
Snorkasaurus
Berserk
Posts: 587
Joined: 30 Dec 2013, 19:19
Contact:

Re: SSH networking

Postby Snorkasaurus » 27 Feb 2014, 19:16

Hey Blackcrack... I actually haven't had a chance to try out smarty yet, but I like the portable feature so I am going to try it soon! Have you tried using it as a portable app with key auth? I'm just wondering how it stores keys when being used as portable.

S.

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: SSH networking

Postby viking60 » 27 Feb 2014, 19:56

Eh... I just tested the portable Kitty version ?
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

Blackcrack
Posts: 300
Joined: 02 Apr 2013, 08:31

Re: SSH networking

Postby Blackcrack » 27 Feb 2014, 20:14

@Snorkasaurus : i think in an subfolder .. i use it via password, so an normal login .. bit i think it works in other possibility's also
@viking60: Kitty it's only a extended version of Putty :) so it is Kitty like Putty, but more extended..

best regards
Blacky

User avatar
Snorkasaurus
Berserk
Posts: 587
Joined: 30 Dec 2013, 19:19
Contact:

Re: SSH networking

Postby Snorkasaurus » 27 Feb 2014, 20:32

Blackcrack wrote:i think in an subfolder .. i use it via password, so an normal login .. bit i think it works in other possibility's also

I think a simple subfolder for storage would be just fine... I like to have a USB stick with a Truecrypt volume full of utilities, then just put the different ports of Truecrypt at the root, works pretty sweet. :s

S.


Return to “Networking”