Showing posts with label putty. Show all posts
Showing posts with label putty. Show all posts

Saturday, June 1, 2013

Putty: generating session configuration from code

I am an automation freak, and I hate doing manual copy and paste of information around.

I have to work on some 30 different accounts, so it's quite nice to store all this info in a CMDB and generate all the Putty session from it.

Unfortunately Putty uses the Windows Registry - which sucks. There are information on how to export this info, but I could not figure out how to store the hostname-username-password.

I find it much easier to bypass putty with MTPutty and generate myself the mtputty.xml file.
Here http://ttyplus.com/multi-tabbed-putty/faq.html they explain how:


I am creating mtputty.xml myself. How can I encrypt my passwords?

You can use XML tag "PlainPassword" instead of "Password". Specify your password under this tag as a plaintext. When you quit MTPuTTY, PlainPassword will be removed automatically, but your password will be saved encrypted.

I will ignore the MTPutty/Servers/Putty section and do only the MTPutty/Internals/Putty/Node. Each node is like this:
<Node Type="1">
 <SavedSession>PH30-0KWP355</SavedSession>
 <DisplayName>PH30-0KWP355_oracle_2228</DisplayName>
 <ServerName>10.140.21.45</ServerName>
 <PuttyConType>4</PuttyConType>
 <Port>2228</Port>
 <UserName>oracle</UserName>
 <Password>g9X5n9zRcaw=</Password>
 <PasswordDelay>0</PasswordDelay>
 <CLParams>-load PH30-0KWP355 10.140.21.45 -ssh -P 2228 -l oracle -pw *****</CLParams>
 <ScriptDelay>0</ScriptDelay>
</Node>



Saturday, April 27, 2013

Accessing your VirtualBox from putty

This video shows how



in a nutshell, don't use the default NAT network configuration, but rather the Bridged Adapter:





Thursday, July 12, 2012

Putty blue is too dark to see

knock knock knocking on heaven's door...

we have 2 files: /etc/DIR_COLORS /etc/DIR_COLORS.xterm TERM envvar should be "linux" echo $TERM xterm mkdir ~/.dircolors cp /etc/DIR_COLORS $HOME/.dircolors this was quite useless, it simply put me in a b/w mode. https://www.linux.com/community/blogs/127-personal/26944
Category: Window > Colours and select ANSI Blue in the Select a colour to adjust to Red:74 Green:74 Blue:255. I do the same for ANSI Blue Bold to Red:140 Green:140 Blue:255

This sort of works.

Saturday, June 2, 2012

Putty multitab

http://www.ttyplus.com/downloads.html

much, much better than having all those Putty windows open...

It has even a "send script" feature, by which you can run the same commands on multiple servers at the same time!

Saturday, April 28, 2012

Xlib: PuTTY X11 proxy: wrong authorisation protocol attempted

I log into myserver as user “myuser”, then “sudo su – soa”; I have X11 forwarding enable on Putty, and XMing running on my laptop.
I run
/opt/oracle/java/bin/jvisualvm
and I get:

Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authorisation protocol attempted

googling for the message I find:

http://froebe.net/blog/2008/11/14/getting-xlib-putty-x11-proxy-wrong-authentication-protocol-attempted-i-have-the-answer/

I try to
cat /etc/ssh/sshd_config
but I get
cat: /etc/ssh/sshd_config: Permission denied

I go back as myuser and I do
xauth list
myserver/unix:10 MIT-MAGIC-COOKIE-1 8ea792a81074c62518d53789faf9558d

then I “sudo su – soa” again and I do
xauth add myserver/unix:10 MIT-MAGIC-COOKIE-1 8ea792a81074c62518d53789faf9558d
xauth: creating new authority file /home/soa/.Xauthority

I run again
/opt/oracle/java/bin/jvisualvm

and it works! Thank you Jason!!!

Useful links:

For info on .Xauthority

Tuesday, April 24, 2012

Public Key Authentication With PuTTY

http://www.ualberta.ca/CNS/RESEARCH/LinuxClusters/pka-putty.html


I run PuTTYgen

provide passphrase
generate key

save public key ssh-rsa in a file ssh-rsa.txt
save private key to myuserpprd.ppk


I log to remote server as myuser

mkdir .ssh
cd .ssh
vi authorized_keys
paste the public key
save

chmod 600 authorized_keys*
run putty
edit the "Private key file for authentication" to provide myuserpprd.ppk

the first login I get

"Authenticating with public key "rsa-key-20120424"
Passphrase for key "rsa-key-20120424":"

Tuesday, November 30, 2010

Instructions to install, configure and run XMing on putty

first of all, make sure there connectivity from your server to your laptop:
log into your server and ping your laptop!


download:
http://sourceforge.net/projects/xming/

execute Xming-6-9-0-31-setup.exe

full installation (choose all defaults)

launch XMing

allow access to all networks

you should see an icon of the XMing XServer 3.0 service in the bottom right


open file X0.hosts in the XMing installation folder and add the IP of your target server (example 11.36.32.93)

restart XMing

create a putty connection and tick "Connection/SSH/X11/Enable X11 Forwarding"
login to your server (example 11.36.32.93)

export DISPLAY=11.192.1.41:0
(10.192.1.41 is your IP, you can find it with ipconfig and look at LAN IP)

to test, run "xclock" in putty

in case of problems, right-click on the XMing icon and "view log"


This error:

Xlib: connection to "11.192.1.41:0.0" refused by server
Xlib: No protocol specified

means that you haven't added the server's IP in X0.hosts