search

Loading

Saturday, November 23, 2013

How to create a user to ssh to the server and then only have super user permission to switch to root user?

I don't want to ssh to my linux server as root user. So I have disabled the direct root login through ssh. I am using a less privileged user to ssh to the server. But I don't want to give him sudo privilege. The only privileged command this user (less privileged user) should be able to run is to switch to root user. How can I achieve this?

I'm using Amazon Linux (which is actually centos based) in my ec2 instance. It comes with 'ec2-user' which has no password and but has sudo privilege and uses ssh key for login. I want to use password login for other users (and don't want to use ssh key for them)[So I can't disable password login "PasswordAuthentication  no" field in sshd_config file]. But I also want to set password for 'ec2-user' as I don't want to use sudo command without password. I have used below setup to achieve this.

How to delete file names with spaces older than 30 days in linux?

I want to delete files which are modified before 30 days from a public folder (uploads) in my linux server. The files are uploaded by different users so it includes white spaces and other characters in the file name. How can I automate this process?

You can use any of the below commands to achieve this:

Saturday, September 7, 2013

How to delete a user from a group using single command in linux?

I have created a user called 'sam' and he is a member of the group 'webdeveloper'. Currently he is on long leave and I want to remove him from the web developer group without deleting this user.  How can I do this? We will find below.

Thursday, August 8, 2013

How to mount NTFS filesystem as read-writable in Mac OSX 10.8 Mountain Lion

Mountain Lion has built in support for read-writable NTFS filesystem. But it is enabled as read only by Apple. This means that you can only read from an NTFS formated hard disk but cannot write data to it.

To make it is as read-writable is very easy. There is no need to install any third party half working solutions or expensive softwares. Follow below steps :

Saturday, August 3, 2013

Download and install the bleeding edge version of elementary os

This post is more like  a note to myself.

Elementary OS is a distro which uses ubuntu as its base os. But unlike the other ubuntu based distros it's a class apart. It uses its own custom developed applications,icons and themes and everything works as a coherent unit.