Category Archives: UNBLOG Tutorials (EN)

THINK UNBLOG Knowledge Network for Tutorials, Howto’s, Workaround, DevOps Code for Professionals. The posts are made on demand contributed by professionals

PuTTY Help: Command-line Options

PuTTY Help for Options in Command-line

PuTTY Help Command-line Options

PuTTY getting and installing

You can download the PuTTY client for Windows from here, or perform the Windows package installer winget in the command prompt.

C:\> winget install PuTTY

PuTTY terminal client for Windows

PuTTY is still a popular versatile terminal client and is mainly used as an ssh terminal emulator in Windows, commonly used for connecting from Windows to the Linux shell. If you want to use PuTTY or the clone KiTTY in the command line, or for processing in batch files, you will quickly notice that the help option is not available. If you try putty -h or putty -help also the -? option does not get any help.

PuTTY Command-line Options Help

That’s why I’ve listed a collection of all known putty command-line options help here.

-1 and -2: specify an SSH protocol version
-4 and -6: specify an Internet protocol version
-A and -a: control agent forwarding
-agent and -noagent: control use of Pageant for authentication
-C: enable compression
-hostkey: manually specify an expected host key
-i: specify an SSH private key
-L, -R and -D: set up port forwardings
-l: specify a login name
-load: load a saved session
-loghost: specify a logical host name
-m: read a remote command or script from a file
-N: suppress starting a shell or command
-nc: make a remote network connection in place of a remote shell or command
-P: specify a port number
-pgpfp: display PGP key fingerprints
-proxycmd: specify a local proxy command
-pw: specify a password
-restrict-acl: restrict the Windows process ACL
-sercfg: specify serial port configuration
-sessionlog, -sshlog, -sshrawlog: specify session logging
-t and -T: control pseudo-terminal allocation
-v: increase verbosity
-X and -x: control X11 forwarding
protocols: -ssh, -telnet, -rlogin, -raw -serial

PuTTY free SSH client for Windows

PuTTY is a versatile terminal client for Windows. It is the world’s most popular free SSH client. PuTTY supports SSH, telnet, and raw socket connections with full featured terminal emulation. The PuTTY client supports public key authentication and Kerberos single-sign-on. It also includes command-line SFTP and SCP implementations, but without command-line help.

PuTTY Key Features

  • Windows client. Mac and Linux ports exist. No server included.
  • Supports both 32-bit and 64-bit Windows. An MSI installer has been available since 2016.
  • Supports SSH client, telnet client, SFTP client (command line only), and rlogin client. Both SSH2 and SSH1 protocols are supported. Note that use of SSH1 is not recommended for security reasons. Practically all devices support SSH2 these days.
  • Supports public key authentication and Active Directory/Kerberos authentication.
  • File transfers only using a separate command-line programs. No integrated file transfer support.
  • No scripting support, but can be used together with WinSCP.

PuTTY SSH client alternatives

There many SSH clients that are more modern. A major shortcoming of PuTTY is that it does not have integrated file transfers in the client itself. Instead, file transfers have to be done via the command-line options (without help). This is too complicated for most users. WinSCP is a versatile and known popular file transfer client. PuTTY also does not include an SSH server.

KiTTY as a fork from PuTTY version 0.76

KiTTY is a free and open source GPU accelerated terminal emulator for Linux and macOS that focuses on performance and features. It is written in C and Python programming languages. KiTTY is only designed for the Microsoft Windows platform, with all the features from the original software, and adds many others as decribed in this website. Just like the original, KiTTY doesn’t provide any help for options in the command-line.

Generate Random Password in PowerShell

In this tutorial, you’ll learn how to quickly and easily generate strong and secure passwords for multiple accounts or in the web using random password generator in Windows PowerShell.

Generate Random Password in PowerShell

PowerShell provides a way to quickly generate random passwords to save time and protect your data. In this post, you will learn how to generate random passwords with different length and complexity requirements using PowerShell commands.

Supporting a random password generator in PowerShell has several benefits. It ensures that the generated passwords are truly random, making them more secure from brute-force attacks than passwords based on predictable patterns or personal information. Additionally, a random password generator allows for automation, making it ideal for scenarios where you need to quickly generate multiple passwords, such as creating user accounts in active directory or setting up service accounts. By using PowerShell, you can create complex and unique passwords without the need for additional tools.

Based on the command known from *nix systems, I call it mkpasswd.

function mkpasswd {
    param (
        [Parameter(Mandatory)]
        [int] $length,
        [int] $NumberOfSpecialChars = 1
    )
    Add-Type -AssemblyName 'System.Web'
    return [System.Web.Security.Membership]::GeneratePassword($length, $NumberOfSpecialChars)
}

Save the lines in the file Microsoft.PowerShell_profile.ps1

The file Microsoft.PowerShell_profile.ps1 must be in the user’s Documents folder, under the WindowsPowerShell folder.

"%USERPROFILE%\Documents\WindowsPowerShell"

This mkpasswd function takes two parameters. The length parameter determines the length of the password, while the NumberOfSpecialChars parameter specifies the number of special characters in the password. By changing these parameters, you can generate passwords that meet your needs.

How to generate a secure password in PowerShell

Open PowerShell and run the password generator with entermkpasswdand hit Enter

mkpasswd 12
SIaWH2kj}iZ$

The number indicates the lenght of the password should have. Without specifying the password length, the prompt asks you to enter a number.

quote Hit. use this one-liner to quick generate a secure password.

PS C:\> -join([char[]](33..122) | Get-Random -Count 12)

Conclusion

Generating strong passwords is an essential part of connected security in today’s global world. Luckily, you don’t have to spend hours struggling with complex passwords when you can easily generate them using PowerShell commands. With just a few actions you can quickly create random passwords that meet current security standards. This way we keep prying eyes away from our data.