If you have an error with ssh client or server itself you should try with followings:
Firstly, you should set extra verbose messages on ssh client outputs with -vvv flag:
ssh -vvv user@host
There are quite usefullinformations in verbose output mode.
Secondly, you should take a look at ssh server logs or syslog records.
If you have a bit strange problem, you have to start another instance of ssh server with debugging enabled on unused port like that:
/usr/sbin/sshd -d -p 5656
and try to connect this instance with:
ssh -vvv -p 5656 user@host
Now you can see both of the client and server side messages. Ssh prints lots of useful information in debugging mode. If you want even more debuggin messages at server side, add another d flags and increase verbosity like that:
/usr/sbin/sshd -ddd -p 5656
- 0 Comment
- Murat Demirten
- 1 day ago
To change time of the system in Linux, you can use date command on the prompt.
date --set=HHMM
where HH is Hour and MM is minute
Example:
date --set=2359
will set the time of the system to 23:59
- 0 Comment
- Halil Demirezen
- 1 day ago
If you accidently create a file which names begins with a dash (-) character, you'll be realize that you can't simply delete this file with regular rm command:
rm -f -testfile
rm: invalid option -- t
Because of the first character is a dash, shell thinks we want to provide an option to rm commands itself. Solution of this problem is to use double dash character -- after our command's options are finished:
rm -f -- -testfile
it works. When -- character seen, shell thinks that optional arguments for command itself finished and doesn't make option parsing anymore.
- 0 Comment
- Murat Demirten
- 6 days ago
SHA (Secure Hash Algorithm) is an algorithm and it is mainly used to verifying integrity of files under linux. Unlike MD5 (it is only 128 bits), SHA uses 160 bits by default (SHA1) and there is 4 another improved version:
sha224: 224 bits
sha256: 256 bits
sha384: 384 bits
sha512: 512 bits
You can learn sha1 sum of a file (160 bits) with:
sha1sum filename
or
shasum -a 1 filename
shasum uility takes -a parameter as 1, 224, 256, 384 and 512 repectively and make calculations for the specified bits length.
- 0 Comment
- Murat Demirten
- 9 days ago
Making some kind of text search and replace operations on a single or multiple files is a trivial task for every Linux system admin or even normal user. There are different ways for this, we just want to describe two of them.
If you already familiar with perl and know a little regular expression syntax, you can use one-line embedded perl usage:
perl -pi -e 's/search/replacement/g;' *.txt
or combine with find and xargs:
find -name "*.html" | \
xargs perl -pi -e 's/search/replacement/g;'
- 0 Comment
- Murat Demirten
- 10 days ago
There are lots of ways to list files and sort by their size with the help of pipe operator, for example:
ls -l | sort -n -k 5
But ls command already has builtin support for this:
ls --sort=size -l
you can reverse the list with -r option:
ls --sort=size -lr
or you may add -h (human-readable) parameter for good looking:
ls --sort=size -lrh
- 0 Comment
- Murat Demirten
- 11 days ago
If you want to force fsck filesystem check on next boot, you can do this with creating an empty file with the name of "forcefsck" on root directory:
touch /forcefsck
If you want to disable fsck running on the next boot, you can do this with creating an empty file with the name of "fastboot" on root directory:
touch /fastboot
Both files will be removed on next boot.
- 0 Comment
- Murat Demirten
- 11 days ago
lsof is one of the little known but very powerfull utility in Linux. Man pages basically says that lsof: list open files. But you can use it for managing and tracking network connections, you can list open ports, identify connections currently being made to your system, and determine what resources a process is using. Not only that, but you can also determine what processes a particular user has and find detailed information about file and directory usage. Here some example usages:
List all open files in system:
lsof
read more- 1 Comment
- Murat Demirten
- 12 days ago
If you can not mount your XFS partition with classical "wrong fs type, bad superblock etc." error and you see a message in kernel logs (dmesg) like that:
XFS: Filesystem sdb7 has duplicate UUID - can't mount
you can still mount the filesystem with nouuid options as below:
mount -o nouuid /dev/sdb7 disk-7
But every mount, you have to provide nouuid option. So, for exact solution you have to generate a new UUID for this partition with xfs_admin utility:
xfs_admin -U generate /dev/sdb7
Clearing log and setting UUID
writing all SBs
new UUID = 01fbb5f2-1ee0-4cce-94fc-024efb3cd3a4
after that, you can mount this XFS partition regularly.
- 0 Comment
- Murat Demirten
- 18 days ago
If you forget your root password, you can easily reset it by entering some options into grub loader when system is being loaded. After system reset, and some bios check, Grub is loaded and there are some choices from which kernel or operating systems to boot.
read more
- 0 Comment
- Halil Demirezen
- 25 days ago
USERBOX
CATEGORIES
MOST READED TODAY
- Remove comments and blank lines from files
- How to extract rpm archive without installing
- XFS Filesystem has duplicate UUID problem
- Solving ssh problems
- Easily installing Internet Explorer 5, 6 and 7 same time
- Recovering mysql root password
- Calculating SHA Checksums
- Using lsof utility
- Changing time in Linux
- Search and replace on multiple files
LAST ADDED
- Solving ssh problems
- Changing time in Linux
- Working filenames in shell begins with a dash character
- Calculating SHA Checksums
- Search and replace on multiple files
- Listing files by size
- Forcing fsck run on next boot
- Using lsof utility
- XFS Filesystem has duplicate UUID problem
- Recovering Root Password
