Friday, October 12, 2012

Remote ssh login issue

If you have reinstalled Linux or UNIX with OpenSSH, you will get the bellow

error. (or else changes in hostname and ip address)
=======
Error
=======

[root@TESTBED ]# ssh root@192.168.x.x
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
8c:32:d8:2c:94:18:4f:7f:7f:2a:15:60:4d:6f:50:79.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:3
RSA host key for 192.168.x.x has changed and you have requested strict

checking.
Host key verification failed.
lost connection
[root@TESTBED ]#

=====================================

Solution :
Add the remote machine as known host as below.
to known host


[root@TESTBED ]# ssh-keygen -R 192.168.x.x
/root/.ssh/known_hosts updated.
Original contents retained as /root/.ssh/known_hosts.old
[root@TESTBED ]#


Saturday, February 11, 2012

SVN from Windows and more on SVN

https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxsaW51eHdlYndvcmxkfGd4OjVhNjA0MjhjZTY4OTY1OQ

SVN and more on SVN

#which svn

If this returns a valid path as output, then it means that svn is installed on your linux box. If not, you need to install it. Installing subversion is very easy (for most distributions) and ample documentation is available on the web. You can start with http://subversion.apache.org/.

Four steps to complete svn repository creation on linux

1. log onto server as root
2. I prefer to have all svn repositories in one directory for better organization and easy maintenance. So next step for me would be to change to my svn directory.

cd /svnRepos

If you do not already have a directory for svn repositories, I would recommend creating one.

mkdir svnRepos

3. Create repository using following command

svnadmin create /path/to/repo/RepoName

where : RepoName is the name of repository to be created. As an example, I want to create a repository for my testproject. I would write

svnadmin create testproject

4. Change group ownership of repository for the intended group. In this case, consider I have a user group created as “all” and I want this group to have ownership to this repository.


chown -R :all /path/to/repo/RepoName
5. Grant Read/Write/Execute permissions to “all” on this repository

chmod -R 770 /path/to/repo/RepoName

6. Go to the /path/to/repo/RepoName/conf dir
and edit teh files. authz passwd svnserve.conf

authz
=====
[groups]
# harry_and_sally = harry,sally
admin = admin

# [/foo/bar]
# harry = rw
# * =
admin = rw


# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
admin = rw
==============================
==============================
passwd
======
[users]
# harry = harryssecret
# sally = sallyssecret
admin = admin123
==============================
==============================
svnserve.conf
==========
[general]
anon-access = none [edit these 4 linies without giving any space]
auth-access = write
password-db = /svnrepo/repo/conf/passwd
realm = repo [repo is my repository name]

===========-------------==============


Kill the process.

[If old repo is thare - killall svnserve]
[ to remove all - rm -rf find .-type d - name svnrepo/]


start the server
==========
svnserve -d --listen-port 2122 -r /svnrepo/repo

svnserve -d --listen-host 172.2x.x.12 -r /svnrepo/repo

svn import /svnrepo/repo/main svn://172.2x.x.12/svnrepo/repo/ -m "Import"

svn checkout svn://172.2x.x.12/svnrepo/repo/

---------------===================----------------===========

try from windows it will work

===================================================

Add folder's in svn

Go to repo dir

mkdir project
svn add project
svn commit project


svn import DATA svn://172.2x.x.33/svnrepo/repo -F DATA/file1

svn import svn://172.2x.x.33/svnrepo/repo -F DATA/file1

====================================================

SVN repository creation on linux in four steps

  1. log onto server as root
  2. I prefer to have all svn repositories in one directory for better organization and easy maintenance. So next step for me would be to change to my svn directory.

cd /svnRepos

If you do not already have a directory for svn repositories, I would recommend creating one.

mkdir svnRepos

  1. Create repository using following command

svnadmin create /path/to/repo/RepoName

where : RepoName is the name of repository to be created. As an example, I want to create a repository for my testproject. I would write

svnadmin create testproject

  1. Change group ownership of repository for the intended group. In this case, consider I have a user group created as “all” and I want this group to have ownership to this repository.

chown -R :all /path/to/repo/RepoName

  1. Grant Read/Write/Execute permissions to “all” on this repository

chmod -R 770 /path/to/repo/RepoName

6. svnserve -d --listen-port 2122 -r /home/demo/repository

Adding user to the sudoers

https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxsaW51eHdlYndvcmxkfGd4OjUyYWZmNTE1MmU3MGI2MTc

Adding Additional Hard Drives in Linux

https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxsaW51eHdlYndvcmxkfGd4OjQxYWZhNTNkODMxZjUzZTk

Restrict the user his home dir at ssh login

1. make a copy of bash with the name of rbash
#cp /bin/bash /bin/rbash

2. Add the user with rbash
[#useradd -s /bin/rbash ]
#useradd -s /bin/rbash admin