Wednesday, July 25, 2012

ssh problems after installtion of Centos 6.3 x64

Centos 6.3 was installed sucessfully.

eth0 ip was 192.168.1.46

I edited the sshd_config file and changed port from 22 to 22421
disabled password authentication

I was not able to ssh to this server @ 192.168.1.46

I was not seeing any errors/messages in /var/log/secure

after some debugging I did the following to fix the issue
- Disabled SELinux

This still did not fix the issue of ssh login but at least it logged messages in /var/log/secure.

looked at /var/log/secure and found that
 the error was
Authentication refused: bad ownership or modes for file /home/wb003c/.ssh/authorized_keys

checked the perms on file and it was
664

changed it to 600 and Viola , ssh started working.


-- Not sure if disabling SELinux also helped me fix the issue. Will research this at another time.


Thursday, July 12, 2012

saving stdout to a different server via ssh

exec_sql.pl -s pd.sql | zip -9 | ssh login@$DEVIP "cat >> /home/user/data.zip"

zip -9 acts as a filter and zips the stdout on the fly.

and on the target machine to unzip do the following

unzip -p data.zip

compare / diff files over ssh - remote file vs local file

ssh remote_user@remote_ip "cat remote_file.ks" | diff  - localfile.ks

This logs into the remote server , concatenates the file and pipes it to diff.
Diff treats the remote file as stdin and compares with localfile

- having ssh key authentication helps as no need to enter the password of the remote server.

Followers

About Me

Torrance, CA, United States