<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open Source Solutions</title>
	<atom:link href="http://www.chubbytux.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chubbytux.com</link>
	<description>Dynamic IT Solutions for Dynamic Businesses</description>
	<lastBuildDate>Tue, 12 Jul 2011 14:41:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Delete / Remove User Account</title>
		<link>http://www.chubbytux.com/2011/07/delete-remove-user-account/</link>
		<comments>http://www.chubbytux.com/2011/07/delete-remove-user-account/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 16:06:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[User Account]]></category>

		<guid isPermaLink="false">http://www.lcwilson.com/?p=152</guid>
		<description><![CDATA[How do I remove a user&#8217;s access from my server? How do I delete a user account under Linux operating systems? You need to use the userdel command to delete a user account and related files from user account. The userdel command must be run as root user. The syntax is as follows: userdel userName [...]]]></description>
			<content:encoded><![CDATA[<p>How do I remove a user&#8217;s access from my server? How do I delete a user account under Linux operating systems?</p>
<p>You need to use the userdel command to delete a user account and related files from user account. The userdel command must be run as root user. The syntax is as follows:</p>
<p>userdel userName</p>
<p>userdel Example</p>
<p>To remove the user vivek account from the local system / server / workstation, enter:<br />
# userdel vivek</p>
<p>To remove the user&#8217;s home directory pass the -r option to userdel, enter:<br />
# userdel -r vivek</p>
<p>The above command will remove all files along with the home directory itself and the user&#8217;s mail spool. Please note that files located in other file systems will have to be searched for and deleted manually.</p>
<p>A Note About /etc/login.defs File</p>
<p>Default values are taken from the information provided in the /etc/login.defs file for RHEL (Red Hat) based distros. Debian and Ubuntu Linux based system use /etc/deluser.conf file:</p>
<p># /etc/deluser.conf: deluser configuration &#8211; Debian / Ubuntu Linux only.</p>
<p># Remove home directory and mail spool when user is removed<br />
REMOVE_HOME = 0</p>
<p># Remove all files on the system owned by the user to be removed<br />
REMOVE_ALL_FILES = 0</p>
<p># Backup files before removing them. This options has only an effect if<br />
# REMOVE_HOME or REMOVE_ALL_FILES is set.<br />
BACKUP = 0</p>
<p># target directory for the backup file<br />
BACKUP_TO = &#8220;.&#8221;</p>
<p># delete a group even there are still users in this group<br />
ONLY_IF_EMPTY = 0</p>
<p># exclude these filesystem types when searching for files of a user to backup<br />
EXCLUDE_FSTYPES = &#8220;(proc|sysfs|usbfs|devpts|tmpfs)&#8221;</p>
<p>Complete Example</p>
<p>The following is recommend procedure to delete a user from the Linux server. First, lock user account, enter:<br />
# passwd -l username</p>
<p>Backup files from /home/vivek to /nas/backup<br />
# tar -zcvf /nas/backup/account/deleted/v/vivek.$uid.$now.tar.gz /home/vivek/</p>
<p>Please replace $uid, $now with actual UID and date/time. userdel command will not allow you to remove an account if the user is currently logged in. You must kill any running processes which belong to an account that you are deleting, enter:<br />
# pgrep -u vivek<br />
# ps -fp $(pgrep -u vivek)<br />
# killall -KILL -u vivek</p>
<p>To delete user account called vivek, enter:<br />
# userdel -r vivek</p>
<p>Delete at jobs, enter<br />
# find /var/spool/at/ -name &#8220;[^.]*&#8221; -type f -user vivek -delete</p>
<p>To remove cron jobs, enter:<br />
# crontab -r -u vivek</p>
<p>To remove print jobs, enter:<br />
# lprm vivek</p>
<p>To find all files owned by user vivek, enter:<br />
# find / -user vivek -print</p>
<p>You can find file owned by a user called vivek and change its ownership as follows:<br />
# find / -user vivek -exec chown newUserName:newGroupName {} \;</p>
<p>You can automate the entire procedure by writing a shell script (to remove any at/cron/print/file jobs etc), which is left as an exercise to the readers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chubbytux.com/2011/07/delete-remove-user-account/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transfer files securely with SFTP</title>
		<link>http://www.chubbytux.com/2011/07/transfer-files-securely-with-sftp/</link>
		<comments>http://www.chubbytux.com/2011/07/transfer-files-securely-with-sftp/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 15:59:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[FTP]]></category>

		<guid isPermaLink="false">http://www.lcwilson.com/?p=144</guid>
		<description><![CDATA[File Transfer Protocol (FTP) was once the most widely used protocol for transferring files between computers. However, because FTP sends authentication information and file contents over the wire unencrypted, it&#8217;s not a secure way to communicate. Secure Copy (SCP) and the more robust SSH File Transfer Protocol (SFTP) address this security concern by providing data [...]]]></description>
			<content:encoded><![CDATA[<p>File Transfer Protocol (FTP) was once the most widely used protocol for transferring files between computers. However, because FTP sends authentication information and file contents over the wire unencrypted, it&#8217;s not a secure way to communicate. Secure Copy (SCP) and the more robust SSH File Transfer Protocol (SFTP) address this security concern by providing data transfer over a fully encrypted channel. You can use these alternatives for transferring files securely over the Internet or any other untrusted network.</p>
<p>Both SCP and SFTP rely on Secure Shell (SSH) as their underlying protocol. SSH establishes a secure and encrypted channel of communication between computers using authentication and encryption based on Public Key Infrastructure. SSH uses encryption for the authentication data exchanged to set up the session and the subsequent data transfer.</p>
<p>SSH server and client software ships with most modern operating systems. Clients for SCP and SFTP are available as part of the OpenSSH suite on most Linux systems. Apart from SCP and SFTP, SSH functions as a suitable platform for setting up remote shell and remote GUI desktop connections, tunneling between computers, setting up a SOCKS proxy for secure browsing, and port forwarding.</p>
<p>SCP and SFTP</p>
<p>SCP is a descendant of Remote Copy (RCP). Unlike in FTP, with SCP you can specify that the modification times, access times, and modes from the original file should be preserved. Also, unlike RCP, SCP can prompt for passwords when needed. Apart from copying files between your computer and a remote host, SCP can also transfer files between two remote hosts.</p>
<p>SCP is a handy command-line tool for batch processing. However, SCP works over SSH1, an older, deprecated version of SSH, so you&#8217;re better off using alternatives like SFTP that work over SSH2.</p>
<p>SFTP is a full-fledged file transfer protocol that implements all the operations found in FTP, including ones SCP doesn&#8217;t handle, such as renaming and deleting remote files.</p>
<p>SFTP runs as an SSH subsystem and works on standard SSH port 22 by default. It alleviates the need to open multiple additional ports on the firewall as in the case of FTP, where ports 20 and 21 need to be opened up for control and data traffic. An SFTP client called sftp is available in OpenSSH suite that ships with most Linux systems.</p>
<p>When using password-based authentication (you can avoid the need to supply passwords if the remote host allows password-less SSH authentication), this is how you would start an SFTP session:</p>
<p>sftp david@192.168.1.1</p>
<p>sftp prompts for a password, and on successful authentication, presents a shell with an sftp> prompt. Once in the sftp shell, you can run commands similar to those available on FTP, such as cd, lcd, ls, chmod, chgrp, get, put, rename, and rmdir. You can end the session by typing exit at the prompt.</p>
<p>SFTP servers</p>
<p>The OpenSSH suite is the most popular open source implementation of SSH. Its server is called sshd. You need sshd running on the server to listen on the SSH port and accept incoming connections. To enable or disable SFTP, you can edit the main sshd configuration file, which is at /etc/ssh/sshd_config by default. SFTP is enabled by default; you can comment out the following line to disable it:</p>
<p>Subsystem sftp /usr/libexec/openssh/sftp-server</p>
<p>You can restrict access to SCP and SFTP, along with rest of SSH functionality, based on the IP address of the connecting host by editing hosts.deny file to include a line like this:</p>
<p>sshd: 192.168.1.1</p>
<p>To block an entire network, you can specify the network and subnet address:</p>
<p>sshd: 192.168.1.0/24</p>
<p>or</p>
<p>sshd: 192.168.1.0/255.255.255.0</p>
<p>SFTP servers can cater clients running on any operating system. Some of the popular SFTP clients on Windows are FileZilla, WinSCP, and DataFreeway.</p>
<p>GUI clients for SFTP</p>
<p>In addition to command-line clients from the OpenSSH suite, the file browsers in popular desktop environments like GNOME and KDE have SFTP client capabilities. In Nautilus on GNOME or Konqueror on KDE, you can type the following in the location field:</p>
<p>sftp:// david@192.168.1.1:/home/david</p>
<p>The file browser prompts for your password, and on successful authentication lists the files from the remote server in the file browser. You can drag and drop these files to copy them, and also right-click on files to change properties like name and permissions. You can double-click on files to open them in a suitable editor or viewer. You can also bookmark any SFTP-based directory so that you can quickly access it next time.</p>
<p>There are also other interesting developments in this area like a new filesystem called SSH File System implemented on top of an SFTP client, making it possible to mount remote file systems seamlessly and securely.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chubbytux.com/2011/07/transfer-files-securely-with-sftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

