Archive

Archive for the ‘ssh’ Category

Change Centos ssh shell color

May 29, 2011 4 comments

When trying to ssh to Cento servers (Versions 5.X, haven’t tried other versions yet), the default directory color blue doesn’t work well with terminals such as Mac OSX Terminal using dark-background and Windows ssh client Putty. I haven’t found a way to change the directory color for a specific user but one to change for ALL users including root. So if you have root access and cannot stand for the hard-to-read color combinations, do the following

1) Edit /etc/DIR_COLORS as root
2) Locate line
DIR 01;34 # directory
and change it into
DIR 01;33 # directory

3) Save the file
4) Do the same steps for file /etc/DIR_COLORS.xterm
5) New logins can now see the new directory color

What step 2) does basically is changing the directory color from blue into yellow (it actually looks golden on black background). Step 1-3 take care of Mac OSX Terminal using Homebrew scheme, step 4 is needed if there are putty users.

EDIT [ 06/07/2011 ]:
Just found the answer to changing dir colors for a specific user here:
http://linuxtoolkit.blogspot.com/2009/06/painting-ls-on-bash.html

Advertisements
Categories: Bash, ssh, Tip

Requirements for a successful password-less ssh setup

May 27, 2011 Leave a comment

OK this password-less ssh issue has bothered me for quite a long time and I am officially making the requirements a post so I (and hopefully you) can benefit from it.

The list is quite simple:
1) chmod go-w ~/
2) chmod 700 ~/.ssh
3) chmod 600 ~/.ssh/authorized_keys

for ssh version 2 you might need to add “2” to the end of authorized_keys, that is, step 3) would become
chmod 600 ~/.ssh/authorized_keys2

Item 1) is easy to overlook, what the command does is to remove write permission for group (g) and others (o) from the home directory.

A good place to trouble-shoot the key-based login problem is /var/log/secure, if you see something like the following

Authentication refused: bad ownership or modes for directory /path/to/the/user_ssh_folder

You know you need to check and fix the ownership of directories/file mentioned in the list.

Categories: ssh, Tip