THE IT IDEAS

  • Home

Tuesday, 7 April 2015

Give permission yo users to run command with SUDO

 THE IT IDEAS     15:45     visudo   

All linux user got this error while run command with restricted user.

"User not in the sudoers file. This incident will be reported"

To provide permission to user to run command with SUDO, Do as followed




#sudo /usr/sbin/visudo   or  visudo

Find below line,

"# Allow members of group sudo to execute any command"


Then add below line without quote.

"username ALL=(ALL) ALL"
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Error : Could not load host key: /etc/ssh/ssh_host_ed25519_key

 THE IT IDEAS     15:40     ssh   

SSH Login error


"Could not load host key: /etc/ssh/ssh_host_ed25519_key"


Run below command to regenerate the missing key. this is resolve your issue.

#ssh-keygen -A
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Create SFTP User with chroot in AWS EC2

 THE IT IDEAS     15:12     ec2.chroot, sftp   

Create User with below command

#adduser --shell=/bin/false theitideas

Provide permission of home directory

#chown root:theitideas /home/theitideas/
#chmod 755 /home/theitideas/

Create Folder to be access via sftp and provide permission

#mkdir /home/theitideas/workspace
#chown theitideas:theitideas /home/theitideas/workspace/
#chmod 755 /home/theitideas/workspace/


Generate ssh key to access instance via sftp


#cd /home/theitideas
#mkdir .ssh
#cd .ssh
#ssh-keygen -t rsa -f theitideas
#touch authorized_keys
#cat theitideas.pub > authorized_keys
#cd ..
#ssh-keygen -A

Change the permission of generated key and .ssh folder

#chmod go-w /home/theitideas/
#chown -R theitideas:theitideas .ssh/
#chmod 700 .ssh/
#chmod 600 .ssh/authorized_keys

Open ssh config file and make below mentioned changes.

#nano /etc/ssh/sshd_config


find
"Subsystem sftp /usr/lib/openssh/sftp-server" line in opened file and add "#" on first to comment out the line


#Subsystem sftp /usr/lib/openssh/sftp-server

and add the following at the bottom of the file:

Subsystem sftp internal-sftp
Match User theitideas
    ChrootDirectory %h
    ForceCommand internal-sftp
    X11Forwarding no
    AllowTCPForwarding no


Once close the file restart the ssh service with below command

#service ssh restart

You can download (theitideas) private key from server then you can able to access sftp connection with private key (theitideas).

command to connect sftp with private key

#sftp -i theitideas theitideas@12.34.56.67


Hurray !!! :)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Saturday, 4 April 2015

How to Delete ElasticBeanstalk bucket

 THE IT IDEAS     09:39     AWS Bucket, s3   

How to Delete ElasticBeanstalk bucket.


If you can’t delete Elastic Beanstalk created bucket, first remove all files inside the bucket then remove the bucket policy.

Go to the bucket’s policy (bucket –> properties –> permissions –> edit bucket policy)

Save the change to the Bucket Policy.

Now right click on the bucket and press delete.


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Wednesday, 1 April 2015

How to Use Python ‘SimpleHTTPServer’ to Serve Files Instantly

 THE IT IDEAS     10:38     python   

How to Use Python ‘SimpleHTTPServer’ to Serve Files Instantly

first check is python available or not.

#python –V

If command return version means you have python installed.


Now reach to your source folder which you wants to serve via http to others. like below

#cd theitideas   <---- folder

Then enter below command to start serve your source folder.

#python -m SimpleHTTPServer

Now you can able to view and download your folder items via http protocol with browser. eg. localhost:8000 or 12.34.56.78:8000
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Tuesday, 31 March 2015

Create new user in AWS EC2

 THE IT IDEAS     17:02     EC2   

Create new user in AWS EC2

First of all user in your Instance
#sudo su
#adduser theitideas   <-- keep password with you to fire command with sudo

Login with new user
#su theitideas

Generate private and public key for new user.
#ssh-keygen -t rsa
#cd /home/theitideas/.ssh/
#touch authorized_keys
#cat id_rsa.pub > authorized_keys

#exit
Make entry to your to access command with sudo in visudo file
#visudo  <-- once this file open find "Allow members of group sudo to execute any command" and enter below mentioned line in that file then save and close.

theitideas ALL=(ALL:ALL) ALL

Provide below permissios 

#chmod go-w /home/theitideas
#chmod 700 /home/theitideas/.ssh
#chmod 600 /home/theitideas/.ssh/authorized_keys

Now copy or download private (id_rsa)key from server to your local machine to login.
#cat id_rsa

All done now you can login with your private key (id_rsa) like below from your machine.

#ssh -i id_rsa theitideas@12.34.45.56

Hurray !!!! :)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Tuesday, 16 December 2014

How to resolve mcrypt extension missing error.

 THE IT IDEAS     14:46     error   

Error Message
"The mcrypt extension is missing. Please check your PHP configuration"

#apt-get install php5-mcrypt
#ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available    or    If this command not work fire below one for latest apache.
#ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/mods-available/
#php5enmod mcrypt
#service apache2 restart

Reload and check error message gone.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Like Us !!!

Recent Posts

Blog Archive

  • ▼  2016 (1)
    • ▼  April (1)
      • How to Install PHP 7.0, Apache 2.4.18, & MySQL 5.7...
  • ►  2015 (12)
    • ►  August (1)
    • ►  May (2)
    • ►  April (8)
    • ►  March (1)
  • ►  2014 (23)
    • ►  December (8)
    • ►  November (12)
    • ►  April (2)
    • ►  March (1)
  • ►  2013 (7)
    • ►  December (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (3)
  • ►  2012 (15)
    • ►  December (6)
    • ►  November (9)

Categories

apache2 EC2 error mysql php ubuntu aws aws rds browser github installation linux mount s3 AWS Bucket CentOS Computer DocumentRoot change How to Benchmarking Webserver IP LAMP Restart Computer SCP command SQL SERVER XRDP administrator amazon rds backup basic commands chat command line disable download drupal ec2.chroot environment external storage device fstab functions geoip gmail google home page iis instance internet java mod rewrite mongodb multiple login network password one password php5 php5-fpm php7 private browsing python repair filesystem repo reset password rhel sa password same computer script sftp share skype ssh tomcat ubuntu 16.04 ubuntu16 visudo windows 8 youtube
JobsMagBlogJobsMag.InThingsGuide

Popular Posts

  • MySQL Basic Commands for Linux
    How to login into mysql prompt For Remote MySQL Server. # [mysql dir]/bin/mysql -h hostname -u root -p   e.g. [mysql dir]/bin/mysql -h...
  • How to make Google Chrome Theme
    Open Google Chrome and open Chrome web store and search my chrome theme Click on Add to Chrome     Click on Add to downloadi...
  • How to run a simple PHP web server
    # php -S localhost:8000 -t /path/to/folder/directory Above command give output like below PHP 5.6.4-4ubuntu6 Development Server started...

Copyright © THE IT IDEAS | Powered by Blogger