:::: MENU ::::

Home

  • Apr 13 / 2017
  • 0
Linux

Quit telnet – Escape character

Stuck with a telnet session that refuses to give you hand back on console?
No worries… You just have to know the correct command to sort this out!

When you are opening a telnet connection, you probably got something like:

So, if you want to quit, you just have to use the “escape character” as indicated. But this character is not designed to be typed with 2 characters like “^” and then “]” – you have to use a direct command that can be different depending on your OS:

  • Windows: Ctrl + $
  • Linux: Ctrl + Alt Gr + ]
  • Mac OS: Ctrl + $

And press Enter once you inserted this escape character so you can get the standard telnet prompt and be able to type quit to exit the prompt.

This will result in a command like:

And here you go – you’re out of telnet ūüôā !

  • Apr 07 / 2017
  • 0
Linux

Display time with history command

When you are using the¬†history¬†command on a UNIX system, by default, you’re only getting an action list with numbers but no date and/or time to complete this history. For that, you have to define an environment variable¬†HISTTIMEFORMAT¬†that will describe how you want to display the timestamp for each command.

To display the timestamp temporarily (during session), you can just export the variable before sending the command:

You will get:

If you want to keep that display for a future session, you have to add this variable to your bash profile and reload your profile:

  • Mar 29 / 2017
  • 0
Uncategorized

MonitWeb – Architecture and security

Check instantly your infrastructure health like certificate expiration or unexpected opened ports. Stay updated with daily security feeds and get custom and automated reports.

Need further assistance for designing your architecture or get some security insights for an existing app? Get in touch with experts to get custom and complete assistance!

MonitWeb: https://www.monitweb.com

  • Mar 24 / 2017
  • 0
Linux

Create multiple symlink by changing name with command find

Let’s imagine that we have the following directory listing:

We would like to get a copy of those files named 2016 with a new name for the 2017 year, but we need to keep same content and retro-compatibility. For that, it’s easier to create some symbolic links of all those files instead of doing copies.

You can so use this command for creating those symlinks:

We are now getting this, as expected:

  • Mar 05 / 2017
  • 0
Linux

Use wget/curl behind a proxy

If your machine is behind a proxy, you probably configured your browser for going through the proxy to reach Internet. But what about command line with curl and wget?

If you want to add the proxy temporarily for some few installations for example, just type (by replacing URL and port with yours):

If you want to make the changes globally and keep it after a restart (or a new login), you can:

  • Add those lines in ~/.wgetrc to make it available only for wget and for the current user
  • Add those lines in /etc/environment to make it work for either curl/wget or any http relevant command:

If you need authentication, you can simply include username and password in your connection string like:

  • Feb 24 / 2017
  • 0
Linux

Reset root password on Linux

Who never forgot a root password on a running machine that you can’t reinstall totally?

Most of the linux distributions do have a recovery partition that you can use for that on startup (I won’t detail this here). But if you don’t have this partition, you can still reset it using generic commands thanks to grub capabilities.

Here is the procedure for resetting root password on most of the linux distros using GRUB:

  1. Reboot the machine
  2. When you get¬†the GRUB menu, go to edit page by pressing e when highlighting¬†the correct line you want to modify (generally it’s the first one, no need to change)
  3. Go to the kernel line and enter e again for editing
  4. Remove the quiet word at the end of the line and replace with that:
  5. Press enter to validate your changes
  6. Press b to boot (that way, changes will only be temporary)
  7. You’re now getting a root bash prompt for your machine
  8. The root filesystem is mounted as readonly by default, you have to mount it as read/write by typing
  9. Use the passwd command to create a new root password (pay attention to keyboard layout that can be different!)
  10. Reboot and log into your server with your freshly created password

You should now be able to connect perfectly to your server with your new password!

Pages:1234567...17
Question ? Contact