Your EC2 box only contain .pem auth to enable password authentication follow the steps By default your ec2 box come with .pem authentication, once you create your user and password for that user you can’t able to login with that credentials because EC2 by default disables that functionality. Edit ssh config file by below command $ sudo vim /etc/ssh/sshd_config Search for PasswordAuthentication setting and setit to yes PasswordAuthentication yes Restart ssh server $sudo /etc/init.d/ssh reload
Example syntax for Secure Copy ( scp ) What is Secure Copy? scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh . Examples Copy the file "foobar.txt" from a remote host to the local host $ scp your_username@remotehost.edu:foobar.txt /some/local/directory Copy the file "foobar.txt" from the local host to a remote host $ scp foobar.txt your_username@remotehost.edu:/some/remote/directory Copy the directory "foo" from the local host to a remote host's directory "bar" $ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar ...
This will work for Rails 3.x onwords Model.skip_callback(“create”,:after,:trigger_my_method) in the above line ‘create’ and ‘after’ represents callback name so it represents ‘after_create’ callback, and the callback method is ‘trigger_my_method’, so totally the above line skips below callback after_create :trigger_my_method You can skip validations just by passing :validate => false as parameter to save method Model.save(:validate => false) As before skipping callback, you can reset same callback for reset by below ling Model.set_callback(“create”,:after,:trigger_my_method) This line will reset the below callback after_create :trigger_my_method Example:- Skip callback and validation and rest the skiped callback Post.skip_callback(“create”,:after,:trigger_my_method) post=Post.new(params[:post]) post.save(:validate => false) Post.set_callback(“create”,:after,:trigger_my_method)
Comments
Post a Comment