Arquivo

Artigos com Etiquetas ‘linux’

Find and replace text – command line

12, Janeiro, 2015 Nenhum comentário

 

Share this : Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrEmail this to someone
Tags:

How to connect connet/mount with SFTP and private key

30, Novembro, 2014 Nenhum comentário

That command should read

Code:

To use sshfs you need to install the package, the command to install it is

Code:

then to mount a remote host as the directory /mnt (your mount point) (you can use any directory you like even ones with stuff in – it will not write over the top of them the contents will just be invisible until you umount). Note the -o ssh_command… option should not be necessary if you have loaded your key using ssh-add /path/to/your/privatekey .

Code:

to unmount where /mnt is your mount point:

Code:

I prefer to use a mount point in my home directory. e.g. /home/username/mnt/ and use that as my mountpoint instead

Share this : Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrEmail this to someone
Tags: , ,

Connect SSH through a proxy in linux terminal

28, Novembro, 2014 Nenhum comentário

With tunneling:

 

Share this : Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrEmail this to someone
Tags: , ,

Mass change file permissions

24, Outubro, 2014 Nenhum comentário

You can change the permissions of all 777 folders to 755 using find as below.

The above command will change all the directories inside /var/www to have the permission set as 755. To verify it, you can use the below command.

To change the permissions of all php files, you can use the below command.

Again, you can use the stat command to verify if the permissions had changed. Or you can even use,

Both stat and ls -ld will display the octal permissions of the file.

Share this : Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrEmail this to someone
Tags:

Remove all SVN directories and files

28, Janeiro, 2014 Nenhum comentário

Remove all directories and files from your project folder:

Share this : Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrEmail this to someone
Tags: ,

VSFTPd Virtual Users

11, Janeiro, 2014 Nenhum comentário

This documenation was created from CentOS using the YUM package manager to keep things simple. Before you dig to deep you need the FTP Server to be installed. You can either install the FTP Server as you install CentOS or YUM group install it after the fact.

If you don’t have VSFTPd installed currently on your CentOS machine.

Needed for creating the user database later.

PAM configuration which configures the usage of the virual database we will be creating from a basic text file below.

In same cases the path of pam_userdb.so it’s different.

 

Add the user the virtual FTP server will use to log in all users.

VSFTPd configuration example used for this setup.

Create your text absed user and passwor

Create your text absed user and password list.

Insert your usernames and passwords

Create your user database from the entries located in the users file created above.

Create your user’s based FTP directory.

 

Fixes: not being able to write once logged into FTP

Fixes: “500 OOPS: cannot change directory”. If SELinux is not enabled or enforcing then this can be ignored.

Fixes: “425 Failed to establish connection” or “Client Error: Failed to retrieve directory listing”. If you have not run some sort of automated firewall utility you may need to add the module ip_conntrack_ftp to your iptables configuration. Just make sure your line includes ip_conntrack_ftp as stated below. If you are not running an iptables based firewall then this can be ignored.

And do this:

Share this : Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrEmail this to someone
Tags: ,

Setup Samba/Windows Shares on XBMC Live

3, Janeiro, 2014 Nenhum comentário

It’s relatively easy to setup samba shares on XBMC Live, but it does require bashing out some commands on the shell. First, you’ll need to install samba using apt-get:

Then, you’ll want to configure your shares by editing the the file named smb.conf, placed in the /etc/samba/ directory. For example, I added the user folder and media folders to be available shares by running the following command:

Update: It looks like this has changed in the more recent versions of Ubuntu that the XBMC Live distribution is packaged with (10.04). You can restart the samba service using the old method:

Scroll down all the way to the bottom of the file, then paste in the following (use right click in Putty to paste something from your clipboard):

After that, restart the samba server using:

Note: I updated the samba configuration above to include the ‘force user’ and ‘inherit permissions’ features as I was having trouble with newly created files not getting the right permissions and logging into samba.

Also, when accessing the shares from Windows, if you left the default security options you can use the account ‘guest’ with no password to access the shares. Otherwise, you can play with the settings to force a local linux account to be used in order to access the shares.

Share this : Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrEmail this to someone
Tags: ,