Tag: linux

Easy Passwordless SSH

Easy Passwordless SSH

Disclaimer: This is not secure and is intended only for basic usage, because it sucks when you can’t implement something so simple in a short time. (example: for file backup to a remote server)

Scenario: You want to access the remote server from the localhost. Or, you want to backup files from localhost to a remote server. All without the trouble of entering password (also removes the human factor and allows automation).

LOCAL:
L$> ssh-keygen -t dsa
Do not type in any passkey. Just press enter.
L$> ls ~/.ssh/
L$> cat ~/.ssh/id_dsa.pub

Copy the entire line, from ssh-dss to [email protected]

Read More Read More

How-To: Flush DNS

How-To: Flush DNS

A reminder to myself. This is something I’ve been asked about a million times. In Windows, it’s very easy. But i always forget or mistype the command in Mac.

Windows

C:\>ipconfig /flushdns

Windows IP Configuration
Successfully flushed the DNS Resolver Cache.

Mac OS X

$ dscacheutil -flushcache (in Leopard)
Reminder to self: ds not dns. Ok? :)

$ lookupd -flushcache (lower versions)

Linux

/etc/init.d/nscd restart
i don't use this, so it doesn't really bother me.
*NSCD is Name Service Cache Daemon
School Teacher on F/OSS and the Law

School Teacher on F/OSS and the Law

This is hilarious. A school teacher from Austin, TX confiscated some Linux (HeliOS) Live CDs from her students. She then emailed the founder Ken Starks, and here’s a snippet of the email:

…observed one of my students with a group of other children gathered around his laptop. Upon looking at his computer, I saw he was giving a demonstration of some sort. The student was showing the ability of the laptop and handing out Linux disks. After confiscating the disks I called a conference with the student and that is how I came to discover you and your organization. Mr. Starks, I am sure you strongly believe in what you are doing but I cannot either support your efforts or allow them to happen in my classroom. At this point, I am not sure what you are doing is legal. No software is free and spreading that misconception is harmful. These children look up to adults for guidance and discipline. I will research this as time allows and I want to assure you, if you are doing anything illegal, I will pursue charges as the law allows. Mr. Starks, I along with many others tried Linux during college and I assure you, the claims you make are grossly over-stated and hinge on falsehoods. I admire your attempts in getting computers in the hands of disadvantaged people but putting linux on these machines is holding our kids back.

This is a world where Windows runs on virtually every computer and putting on a carnival show for an operating system is not helping these children at all. I am sure if you contacted Microsoft, they would be more than happy to supply you with copies of an older verison of Windows and that way, your computers would actually be of service to those receiving them…

Head over to HeliOS blog to read Stark’s reply/reaction.

Links:
Linux – Stop Holding Our Kids Back at HeliOS Blog
School Teacher Accusing a Student and Open Source of Breaking the Law at nixCraft

How-To: SNMP for Mac and Linux

How-To: SNMP for Mac and Linux

Note-taking time.. Again, some stuff i don’t usually use or encounter, so i better log them.. for future use.

Linux

  • yum -y install snmp
  • vi /etc/snmp/snmpd.conf
  • replace community string
  • service snmpd start
  • chkconfig snmpd on
  • ps ax| grep snmp: /usr/sbin/snmpd -Lsd -Lf /dev/null -p /var/run/snmpd.pid -a

Mac OS X 10.4 Xserve

  • From command land: snmpconf
  • Copy snmpd.conf (generated from snmpconf) to /usr/share/snmp/ folder
  • vi /etc/hostconfig
  • Edit and set to yes: SNMPSERVER=-YES-
  • Reboot.. or start snmpd (/usr/sbin/snmpd)
  • Test: snmpwalk -v1 -c <your-community-string> 127.0.0.1

To allow snmp in iptables:

# SNMP
$IPTABLES -A INPUT -p udp -s 0/0 –sport 1024:65535 -d $INTIP –dport 161:162 -m state –state NEW,ESTABLISHED -j ACCEPT
$IPTABLES -A OUTPUT -p udp -s $INTIP –sport 161:162 -d 0/0 –dport 1024:65535 -m state –state ESTABLISHED -j ACCEPT

How-To: Troubleshoot NFS

How-To: Troubleshoot NFS

I’ve been using NFS ever since but not exactly the one to set up the server. When the ff. problem occurred, I never imagined I have very little idea as to where to start troubleshooting: Could not chdir to home directory /home/User: No such file or directory.

Well i know the directory’s shared via NFS from another server, so i had to start from there. So here’s a short list of things to check or do (Redhat/Fedora/CentOS based):

On the server:

  1. Make sure NFS is running. Two services should be running: portmap and the NFS service. Try to restart the services.
  2. portmap: /etc/init.d/portmap restart
    nfs: /etc/init.d/nfs restart
    Check if it runs at startup.
    chkconfig --list | grep nfs
    chkconfig nfs on

  3. Check /etc/exports. This is a list of shared volumes
  4. /export 10.1.2.0/24(rw,sync,root_squash,no_wdelay,no_subtree_check,secure)

  5. Check /etc/hosts.allow and /etc/hosts.deny. Lists allowed remote and denied clients to access the server.
  6. ALL: 10.36.13.0/24

    Read More Read More