Posted November 16, 2008 at 10:11pm in
Sysadmin
No I’m not excited about sudo, well I sorta am. I have run into situations where I typed a long command and forgot to type sudo. This is a huge problem when you can’t hit the home key and go to the start of the command, which happens in a lot of SSH tools.
The Fix!!!
sudo !!
Typing that will execute the last command, but it will execute it as if you had typed sudo at the beginning. This is a huge time saver.
Posted November 16, 2008 at 10:11pm in
Sysadmin
Similar to the double bang trick is bang+asterisk. This combinations takes just the parameters from the previous command.
[user@host ~]$ ls /home
user
[user@host ~]$ cd !*
cd /home
[user@host home]$
Enjoy!
Posted November 16, 2008 at 12:11pm in
Linux, Programming, Sysadmin
I have noticed a few people have been commenting on their development environments and wanted to chime in on what I use when I am consulting or working on a personal project.
Internet Based:
- Dropbox – This application allows me to share files between all of my platforms. It works very similar to how subversion works, but commits the files automatically after they have been added to the directory. They are stored encrypted on the Dropbox servers so the information is safe from prying eyes.
- Twitter – I never got the whole twitter thing for a long time, but it is nice to know what my friends are up to.
- Facebook – Probably the only decent social networking site out there
- LinkedIn – Business social networking.
- del.icio.us – Social bookmarking.
- Pownce – Similar to twitter, but does more for media sharing.
Read the rest of this entry »
Posted October 19, 2008 at 10:10pm in
Security, Sysadmin
Update: I just thought about binding to a specific address to help prevent others from being able to ssh into a server. This is similar to changing the port except that there are a limited number of ports, you could bind to xf1er.domain.com and it would be forever before someone was able to brute force the address alone unless the DNS servers allowed zone transfers. The best solution is to probably use a dedicated IP address for ssh, one that nothing else is using and that nothing can resolve to. The reason is that say you had set ListenAddress to xf1er.domain.com if that resolves to the same IP as domain.com or www.domain.com it will still let you ssh in. It is not like setting the address for a particular site in Apache, where it will actually need to match the domain name.
Recently someone on the SoCal LinuxUsers mailing list was asking for information, a checklist or sorts on procedures to lock down your Linux box when putting it on the big bad internet. I will probably collect a lot more of these and make a real checklist, but this will get you started. Note that some of the configuration directives for OpenSSH are already set by default, I prefer to make the change in the config file anyway to ensure those things are set. You never know when an error might occur in an update and something could have been maliciously changed in the code or an accident happened.
- Install and Configure DenyHosts
DenyHosts will add hosts to your /etc/hosts.deny file based on criteria you set and if you like it can download a file which is updated with hosts currently violating DenyHosts policies on other machines. For a lot of services you have to run them in xinetd or inetd for TCP wrappers to work, without TCP wrappers being involved in the daemon hosts.deny/hosts.allow will do nothing for you. The alternative to xinetd and inetd being involved is support for the libwrap library, which most OpenSSH packages have built in when compiled. You can check if a daemon has libwrap support by following the guide on ducea.com.
All about Linux has a good post explaining how to use TCP wrappers to secure Linux.
Read the rest of this entry »
Posted October 19, 2008 at 10:10pm in
Sysadmin
The first thing we need to do is create the public key. For this post we will use localmach for the local machine and remotemach for the remote machine.
Before beginning the following should be set on the remotemach in /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
Read the rest of this entry »