how to automate the logins on puttycm? - putty

I got puttyCm, I need to log in to my devices for once and let the putty store it..later i can come and enter automatically with out entering the passwords again?
can u show me the way pls?
in addition,
if one device can be reached thru other devices..how to implement it?

You can follow below procedure (I assume that you have already engaged your puttycm with corresponding putty.exe or equivalent):
Just open any of your desired putty window by telnet or ssh (no need to login)
Right click on that window and click 'Configuration'; a window should pop up for same
In its 'Connection' tab on left side you can see check box called 'Enable Login macro mode'; select that
Now click on the tab 'Login Macro' again on left side; you can see Login / Password etc. fill them correctly (if you want to see the password which you type, you can click an EYE symbol next to it; that makes it visible until clicked again)
Once you login, if you want to enable some 'Post-login command' then check that box too; now you can write commands like 'bash' or 'myscript' etc in those command rows
Click 'OK' and verify by opening new windows (ctrl + u) of same ip addresses

I have not worked with puttycm, but my Putty experience tells me that puttyagent that comes with putty is an answer for your question.
Putty-agent stores any private keys you provide to it and uses them for automated authorization. Private-key can be added by means of standard ssh-agent tools like ssh-add or can be browsed to with GUI.

Related

Directly edit files of an FTP server using Atom

I have tried time and time again to get remote-edit working within atom. I have added my known working FTP server, click on the Browse Hosts button, and attempt to connect. I am 100% sure the username and password are correct. I don't know what kind of data to provide, other than it worked once, but has never worked again.
From a look at the source, remote-edit prints all errors to the console. To open the console, open the View menu, then browse to Developer and click Toggle Developer Tools. Or use the shortcut CmdAltI (it's probably CtrlAltI on Windows.) This should help finding the cause of your problem.

Can you remap keys of a specific keyboard?

I've got two keyboards attached to my computer. A normal full-size keyboard and a numeric keypad. I want to "remap" the keys on the numeric keypad, but leave the full keyboard alone. So, when the user presses "5" on the keypad it would get remapped to the "Media Play" key, but if the same "5" was pressed on the keypad of the full keyboard, I'd get a "5". In essence, I want to turn that seperate numeric keypad into a media control device.
Unfortunately I'm not sure how to make this work. There is a "Raw Input" feature of Windows which allows to distinguish between keyboards, but that only allows to read the keys - not remap them. There are keyboard hooks (low level and high level) which can remap the keystrokes, but they don't distinguish between keyboards.
Can I make a combination of the two methods work? For that I'd have to be sure that the raw input message is processed before the keyboard hook kicks in. Is that so?
Also, I've read that Windows for some reason does not allow to use Raw Input and Keyboard Hooks in the same process. I could work around that by making 2 different processes, but that becomes more fragile because of communication latency (keyboard hooks have very limited time in which they must complete their work).
Is this doable at all?
In the end it turned out I needed a custom keyboard driver to accomplish this. Fortunately I found one ready for taking - Interception. The app is ready and works perfectly. :)
I wanted to expand on the answer by Vilx as I've revisited this post several times, and I've only just managed to remap my second keyboard so the keys act uniquely. This is done using Interception and Intercept together, and it's the only working solution that I've managed to get working so far.
I'm also looking into using a raspberry pi to remap a second keyboard. Although early days, I think it it's achievable: Plug keyboard into Pi, plug Pi into PC and write script to turn input keycodes into customized output commands / keycodes. Will update when I have tested.
My working Intercept solution is completely based on a Github tutorial by TaranVH which details the process the best so far. I've copied his solution below with some amends of my own.
DOWNLOADING INTERCEPTION:
Navigate to this page: https://github.com/oblitum/Interception
Click on "download the latest release."
Click on Interception.zip to download it.
Unzip the file to a folder on your computer - I recommend using a folder location that won't ever move. I put my Interception folder into C:\Program Files\ and I'll be using this location in my examples.
INSTALLING INTERCEPTION:
Open a terminal as administrator and type cd "C:\Program Files\Interception\command line installer"
Hit Enter
Now, type in the following line of text exactly as shown:
install-interception.exe /install
Hit Enter
Once the program installs sucessfully, you still must restart your computer in order to complete the installation.
(If you ever want to UNinstall interception, watch this): https://www.youtube.com/watch?v=Hn18vv--sFY
INSTALLING INTERCEPT - (This is different from intercepTION!)
Download Kamaz's intercept.exe zip from one of these locations:
http://octopup.org/img/code/interception/intercept.zip
https://github.com/TaranVH/2nd-keyboard/blob/master/Intercept/intercept.exe
Unzip it if it's a .zip file and locate intercept.exe
To keep these files all in one place, I moved intercept.exe into C:\Program Files\Interception\
Reboot your system.
SETTING UP INTERCEPT
Plug in your second keyboard and ensure that it is working normally.
Go to where you saved intercept.exe and double click to open.
Intercept will open as a terminal, and from there you should have basic instructions to start remapping your keyboard.
Type a to add a key.
On the SECONDARY keyboard, press the Q key once. (this is the key that you are remapping)
You will be prompted with Enter combo for this trigger, end with ESC.
Carefully execute the following keystrokes (it doesn't matter which keyboard): Win + E (That is: hold down the windows key while pressing the letter E. I've found you need to do this quickly and accurately, if you hold down too long, extra keypresses are added)
When I did it, this was shown in the terminal: [Left Windows]↓ [E]↓ [E]↑ [Left Windows]↑
Press Esc and you will be prompted to label the script
I labelled mine Q->WinE so I knew what it was doing.
Press Enter to accept the label
Press S to save the filter, or C to cancel if you made a mistake.
Add more filters or close the terminal.
USING INTERCEPT
Now you've set up a custom key command, you need to apply the filter to use it.
Open up intercept.exe
Press Y to apply the filters, you will get confirmation that the filters have been activated.
Now, when you press Q on your second keyboard, Intercept will change the command to Win+E which will open File Explorer.
Caveat:
Please read TaranVH githubs page on this https://github.com/TaranVH/2nd-keyboard/tree/master/Intercept as it provides some further details and troubleshooting.
Please take care to follow the instructions very exactly as there's very little error handling in this process
In this article http://vlaurie.com/computers2/Articles/remap-keyboard.htm is explained how to remap keys of a keyboard. Hope that helps.

modify per-application access control for private key via command line?

I have a cert in a key chain that contains a private key. I'd like to add an application to the access control "white list" for that key. I know how to do this using the graphical key chain tool, but I'd like to do it via the command line as part of an Xcode build script.
From what I can tell the "security" command is the way to manipulate key chains at the command line, but I can't figure out from the man page how I'd go about accomplishing this task.
For completeness, here's exactly what I do in the key chain tool that I'd like to do via the command line:
Click the cert to show its private key.
Right-click the private key and select the "Get Info" menu item.
Click the "Access Control" tab.
Click the "+" button to add an application to the white list.
Select the application (in my case Xcode) and click "Add".
I might also be interested in how to allow access to all applications.
I don't think there is any way from security to do this after the key was imported. However, if you're importing the key for the first time, you can use the -T flag:
-T Specify an application which may access the imported key
(multiple -T options are allowed)
So in my case I was able to do this:
security import my.key -P mypassword -T /usr/bin/pkgbuild
And everything worked!
Disclaimer
I'm honest this is probably not the best place to post this... but I stumbled onto this (and several other) entries with more or less the same problem. See also https://stackoverflow.com/a/34388302/359100. But since I found a solution which could help other people who try to change access control for private key in Keychain via remote session my solution could help...
B/c for me importing via CLI did not work (using -T or -A). I always got that pop regarding access from Keychain.
BTW: If you know a better SO answer where this belongs... please let me know or move it there...
Solution
Create a Keychain on your local machine. E.g. name it apple-development[.keychain]. Add there your private keys and assign necessary access control (best: "Allow all ..."). Now copy that keychain to your remote Mac and add it there via Keychain application (File / Add Keychain...). For CI you maybe do something like this:
security unlock-keychain -p YOUR-KEYCHAIN-PASSWORD "${HOME}/apple-development.keychain"

How to auto login to windows account?

I am researching ways to auto login to a windows server, so applications can be restarted on reboot if the server crashes. Do windows services load before or after a user logs in? Can a windows service be used to login to an account?
If not, is there any way to use some sort of login script to facilitate automatically loggin in?
For auto login. Here is one of them:
To use Registry Editor (Regedt32.exe) to turn on automatic logon, follow these steps:
Click Start, and then click Run.
In the Open box, type Regedt32.exe, and then press ENTER.
Locate the following subkey in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Double-click the DefaultUserName entry, type your user name, and then click OK.
Double-click the DefaultPassword entry, type your password, and then click OK.NOTE: If the DefaultPassword value does not exist, it must be added. To add the value, follow these steps:
On the Edit menu, click New, and then point to String Value.
Type DefaultPassword, and then press ENTER.
Double-click DefaultPassword.
In the Edit String dialog, type your password and then click OK.
NOTE: If no DefaultPassword string is specified, Windows automatically changes the value of the AutoAdminLogon key from 1 (true) to 0 (false), disabling the AutoAdminLogon feature.
On the Edit menu, click New, and then point to String Value.
Type AutoAdminLogon, and then press ENTER.
Double-click AutoAdminLogon.
In the Edit String dialog box, type 1 and then click OK.
Quit Registry Editor.
Click Start, click Shutdown, and then type a reason in the Comment text box.
Click OK to turn off your computer.
Restart your computer. You can now log on automatically.
Taken from: http://support.microsoft.com/kb/324737
Services run regardless of whether a user logs on. If you need an application to run all the time, have you considered converting it to a service? Auto-logon is a security risk.
Windows Services do load before user logins. A Windows service cannot be used to login to an account, but you can specify the account to run the service under. You can setup automatic login in the registry under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon. AutoAdminLogon, DefaultUserName, DefaultPassword, DefaultDomainName, and ForceAutoLogon are the keys you will need to set. They are all strings.
P.S. This is more a Server Fault \ Super User question.
Services start before login.
And rather than using a service to log into an account, why not just set the account to auto log in?
http://www.expta.com/2008/03/how-to-enable-autologon-in-windows.html.
*edit*Beaten to it*
I have tested it on:
WIN10 updated Jan-2016
WIN7 updated Jan-2016
And it works!
I use this .REG file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"AutoAdminLogon"="1"
"DefaultDomainName"="DOMAINNAME"
"DefaultUserName"="USERNAME"
"DefaultPassword"="PASSWORD"
Extracted from: http://www.sysadmit.com/2016/01/windows-configurar-autologin.html
Maybe systinternals/autologon.exe should be mentioned here.
It has a very simple gui and can also be used by command line only.
I guess it does the registry entry in the background.

Closing ASPxPopupControl and Reset Login Dialogs

I am creating a login usercontrol. I have added the following buttons: Recover Password, Change Password & Edit Profile.
I am using DevExpress's ASPxPopupControl to host the functions associated with those three buttons.
There are two problems
When the popup is opened I need to be able to close/hide it using a command button
When a user starts using one of the login controls and chooses to close the dialog the next time the dialog is opened it does not start at the beginning.
(e.g. Start the change password dialog, enter some information, close the popup; the information you started with is not cleared)
Any ideas?
Here is a link to help you with closing the popup on a keypress. You can use the Escape key as in this example or code your own.
http://www.devexpress.com/Support/Center/p/Q209168.aspx
For resetting the values, it appears this is manual.
http://www.devexpress.com/Support/Center/p/Q252942.aspx

Resources