Showing posts with label scp linux. Show all posts
Showing posts with label scp linux. Show all posts

Monday, May 20, 2013

I am accessing my home linux box remotely from work. How can I copy files from that linux comp to my local com

Q. I am accessing my home linux computer remotely from my MacBook via SSH. I am behind a NAT, so I don't have a static IP. I want to retrieve some files from that linux box to my MacBook. Is there a reverse SCP command that I can use so that I can SCP the file from my home linux box to my MacBook at work through the already established tunnel?

A. You use scp direct (not through the tunnel). It can copy either way. One option is to log in to your Linux box through ssh, then use scp to the Mac from there. you would need the address of the mac, and forwarding set up at its' router. Alternatively use the scp from the mac console to your Linux machine. You must have its' address if you can ssh to it.

Is there a way to easily shutdown a remote linux server with a shell script?
Q. I have 3 linux servers hooked to my UPS. I can only hook the UPS to one of them. The UPS software will allow me to run a shell script on that one server before it shuts down. And I want that shell script to shut down the other 2 servers. Is this possible?
@ Roland J: I AM FULLY AWARE OF HOW TO SHUTDOWN A LINUX MACHINE.

@ Roland J: Please donât answer a question unless you actually READ the question!!!!! It makes other people think the question is answered, when in reality, your just lazy to even read the full title of the question. (or you donât know what the word âremoteâ means)

I need to know how to shutdown a linux machine REMOTELY.

This means that I want to run a script on LinuxBox1 and have LinuxBox2 (another linux server on same LAN) shut down.

A. Actually SSH would have to be set up first to allow passwordless, login between servers.

I found the solution else where, and just wanted to post it here, in case anyone else stubles on this question looking for an answer.

NOTE: IN THE RESOLUTION BELOW MANY OF THE COMMANDS ARE CUT OFF, OR INCORECTULY SHOW AS TWO LINES. FOLLOW THIS LINK FOR A PROPERLY FORMATED ANSWER.
http://www.justlinux.com/forum/showthread.php?p=863427#post863427

RESOLUTION:
Here's what I did...

First I ssh'd from each machine to each other one. (The first time u ssh to new machine it asked you to accept the machines "fingerprint" and saves it -- this is just so they know who each other are.

Then on the machine I wanted to be able to shutdown FROM I did
[CODE]
cd /root/.ssh/
ssh-keygen -t rsa
[/CODE]
and accepted the default location. (/root/.ssh/id_rsa)
I left the passphrase blank, so it would not be required.

Then basically you just need to copy that "id_rsa" file onto the DESTINATION machine, in the same directory, but named as "authorized_keys". Which can easily be done like this:
[CODE]
scp id_rsa.pub xxx.xxx.xxx.xxx:/root/.ssh/authorized_keys [/CODE]
Where xxx.xxx.xxx.xxx is the IP address or host name of remote machine.

[INDENT]NOTE: You may want to check if a file by that name already exists, on the remote machine, because the above command will overwrite it without warning. -- If you already have a file by that name on the remote machine, I would suggest using command above, but change the file name. Then on the remote machine, append the file you just copied to the existing one. This could easily be done like this: (there may be an even simpler way - but this is what I know)

[CODE]mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.backup
cat /root/.ssh/authorized_keys.backup /root/.ssh/yourfilename > /root/.ssh/authorized_keys
[/CODE]
[/INDENT]

Then make sure the /root/.ssh/authorized_keys file has 600 permissions.
[CODE]
chmod 600 /root/.ssh/authorized_ keys
[/CODE]

Then try to ssh to the remote machine.
[CODE]
ssh xxx.xxx.xxx.xxx
[/CODE]
And if it works like it did for me -- it will let you right in, with no username or password. If this works correctly, you should be able to remotely run commands through ssh within scripts.

scp files from my school computer to my home computer?
Q. I just purchased an iMac for my home office and I want to copy files from my Linux machine at school to my iMac at home. My iMac is on a wireless router. I open up a terminal and use ssh, but I'm having issues copying files over. I tried scp filename username@home_ip_address:~ but it doesn't work. Any suggestions?

A. on your imac:
scp your_school_account@ \
your_school_machine:/home/juan/filename .
(two lines because Yahoo Answers didn't display it right)

or Charlie Kelly's method:
sftp your_school_account@your_school_machine
get filename

another option is to use a GUI if you prefer:
download Cyberduck, a free FTP client for Macs



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Friday, May 10, 2013

How do I transfer files to and from my computer I'm remotely connected to through SSH?

Q. I want to be able to transfer files to and from my home computer remotely while accessing it from an SSH connection...How do I do this? Do I need to set up an FTP server on my home computer? It's running Debian Linux and I access it from my Android phone using ConnectBot.

A. If it's running an ssh server that will include scp and usually sftp.
You can connect with any scp/sftp client like winscp, rsync. If you set up SSH keys access you need not bother with passwords (though it's still a good idea to have some passphrase in case you lose the phone)

ftp is less secure, unless you use SSL

I am accessing my home linux box remotely from work. How can I copy files from that linux comp to my local com
Q. I am accessing my home linux computer remotely from my MacBook via SSH. I am behind a NAT, so I don't have a static IP. I want to retrieve some files from that linux box to my MacBook. Is there a reverse SCP command that I can use so that I can SCP the file from my home linux box to my MacBook at work through the already established tunnel?

A. You use scp direct (not through the tunnel). It can copy either way. One option is to log in to your Linux box through ssh, then use scp to the Mac from there. you would need the address of the mac, and forwarding set up at its' router. Alternatively use the scp from the mac console to your Linux machine. You must have its' address if you can ssh to it.

Is there a way to easily shutdown a remote linux server with a shell script?
Q. I have 3 linux servers hooked to my UPS. I can only hook the UPS to one of them. The UPS software will allow me to run a shell script on that one server before it shuts down. And I want that shell script to shut down the other 2 servers. Is this possible?
@ Roland J: I AM FULLY AWARE OF HOW TO SHUTDOWN A LINUX MACHINE.

@ Roland J: Please donât answer a question unless you actually READ the question!!!!! It makes other people think the question is answered, when in reality, your just lazy to even read the full title of the question. (or you donât know what the word âremoteâ means)

I need to know how to shutdown a linux machine REMOTELY.

This means that I want to run a script on LinuxBox1 and have LinuxBox2 (another linux server on same LAN) shut down.

A. Actually SSH would have to be set up first to allow passwordless, login between servers.

I found the solution else where, and just wanted to post it here, in case anyone else stubles on this question looking for an answer.

NOTE: IN THE RESOLUTION BELOW MANY OF THE COMMANDS ARE CUT OFF, OR INCORECTULY SHOW AS TWO LINES. FOLLOW THIS LINK FOR A PROPERLY FORMATED ANSWER.
http://www.justlinux.com/forum/showthread.php?p=863427#post863427

RESOLUTION:
Here's what I did...

First I ssh'd from each machine to each other one. (The first time u ssh to new machine it asked you to accept the machines "fingerprint" and saves it -- this is just so they know who each other are.

Then on the machine I wanted to be able to shutdown FROM I did
[CODE]
cd /root/.ssh/
ssh-keygen -t rsa
[/CODE]
and accepted the default location. (/root/.ssh/id_rsa)
I left the passphrase blank, so it would not be required.

Then basically you just need to copy that "id_rsa" file onto the DESTINATION machine, in the same directory, but named as "authorized_keys". Which can easily be done like this:
[CODE]
scp id_rsa.pub xxx.xxx.xxx.xxx:/root/.ssh/authorized_keys [/CODE]
Where xxx.xxx.xxx.xxx is the IP address or host name of remote machine.

[INDENT]NOTE: You may want to check if a file by that name already exists, on the remote machine, because the above command will overwrite it without warning. -- If you already have a file by that name on the remote machine, I would suggest using command above, but change the file name. Then on the remote machine, append the file you just copied to the existing one. This could easily be done like this: (there may be an even simpler way - but this is what I know)

[CODE]mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.backup
cat /root/.ssh/authorized_keys.backup /root/.ssh/yourfilename > /root/.ssh/authorized_keys
[/CODE]
[/INDENT]

Then make sure the /root/.ssh/authorized_keys file has 600 permissions.
[CODE]
chmod 600 /root/.ssh/authorized_ keys
[/CODE]

Then try to ssh to the remote machine.
[CODE]
ssh xxx.xxx.xxx.xxx
[/CODE]
And if it works like it did for me -- it will let you right in, with no username or password. If this works correctly, you should be able to remotely run commands through ssh within scripts.



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Friday, April 19, 2013

I am accessing my home linux box remotely from work. How can I copy files from that linux comp to my local com

Q. I am accessing my home linux computer remotely from my MacBook via SSH. I am behind a NAT, so I don't have a static IP. I want to retrieve some files from that linux box to my MacBook. Is there a reverse SCP command that I can use so that I can SCP the file from my home linux box to my MacBook at work through the already established tunnel?

A. You use scp direct (not through the tunnel). It can copy either way. One option is to log in to your Linux box through ssh, then use scp to the Mac from there. you would need the address of the mac, and forwarding set up at its' router. Alternatively use the scp from the mac console to your Linux machine. You must have its' address if you can ssh to it.

Is there a way to easily shutdown a remote linux server with a shell script?
Q. I have 3 linux servers hooked to my UPS. I can only hook the UPS to one of them. The UPS software will allow me to run a shell script on that one server before it shuts down. And I want that shell script to shut down the other 2 servers. Is this possible?
@ Roland J: I AM FULLY AWARE OF HOW TO SHUTDOWN A LINUX MACHINE.

@ Roland J: Please donât answer a question unless you actually READ the question!!!!! It makes other people think the question is answered, when in reality, your just lazy to even read the full title of the question. (or you donât know what the word âremoteâ means)

I need to know how to shutdown a linux machine REMOTELY.

This means that I want to run a script on LinuxBox1 and have LinuxBox2 (another linux server on same LAN) shut down.

A. Actually SSH would have to be set up first to allow passwordless, login between servers.

I found the solution else where, and just wanted to post it here, in case anyone else stubles on this question looking for an answer.

NOTE: IN THE RESOLUTION BELOW MANY OF THE COMMANDS ARE CUT OFF, OR INCORECTULY SHOW AS TWO LINES. FOLLOW THIS LINK FOR A PROPERLY FORMATED ANSWER.
http://www.justlinux.com/forum/showthread.php?p=863427#post863427

RESOLUTION:
Here's what I did...

First I ssh'd from each machine to each other one. (The first time u ssh to new machine it asked you to accept the machines "fingerprint" and saves it -- this is just so they know who each other are.

Then on the machine I wanted to be able to shutdown FROM I did
[CODE]
cd /root/.ssh/
ssh-keygen -t rsa
[/CODE]
and accepted the default location. (/root/.ssh/id_rsa)
I left the passphrase blank, so it would not be required.

Then basically you just need to copy that "id_rsa" file onto the DESTINATION machine, in the same directory, but named as "authorized_keys". Which can easily be done like this:
[CODE]
scp id_rsa.pub xxx.xxx.xxx.xxx:/root/.ssh/authorized_keys [/CODE]
Where xxx.xxx.xxx.xxx is the IP address or host name of remote machine.

[INDENT]NOTE: You may want to check if a file by that name already exists, on the remote machine, because the above command will overwrite it without warning. -- If you already have a file by that name on the remote machine, I would suggest using command above, but change the file name. Then on the remote machine, append the file you just copied to the existing one. This could easily be done like this: (there may be an even simpler way - but this is what I know)

[CODE]mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.backup
cat /root/.ssh/authorized_keys.backup /root/.ssh/yourfilename > /root/.ssh/authorized_keys
[/CODE]
[/INDENT]

Then make sure the /root/.ssh/authorized_keys file has 600 permissions.
[CODE]
chmod 600 /root/.ssh/authorized_ keys
[/CODE]

Then try to ssh to the remote machine.
[CODE]
ssh xxx.xxx.xxx.xxx
[/CODE]
And if it works like it did for me -- it will let you right in, with no username or password. If this works correctly, you should be able to remotely run commands through ssh within scripts.

scp files from my school computer to my home computer?
Q. I just purchased an iMac for my home office and I want to copy files from my Linux machine at school to my iMac at home. My iMac is on a wireless router. I open up a terminal and use ssh, but I'm having issues copying files over. I tried scp filename username@home_ip_address:~ but it doesn't work. Any suggestions?

A. on your imac:
scp your_school_account@ \
your_school_machine:/home/juan/filename .
(two lines because Yahoo Answers didn't display it right)

or Charlie Kelly's method:
sftp your_school_account@your_school_machine
get filename

another option is to use a GUI if you prefer:
download Cyberduck, a free FTP client for Macs



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Saturday, March 23, 2013

Is there a way to easily shutdown a remote linux server with a shell script?

Q. I have 3 linux servers hooked to my UPS. I can only hook the UPS to one of them. The UPS software will allow me to run a shell script on that one server before it shuts down. And I want that shell script to shut down the other 2 servers. Is this possible?
@ Roland J: I AM FULLY AWARE OF HOW TO SHUTDOWN A LINUX MACHINE.

@ Roland J: Please donât answer a question unless you actually READ the question!!!!! It makes other people think the question is answered, when in reality, your just lazy to even read the full title of the question. (or you donât know what the word âremoteâ means)

I need to know how to shutdown a linux machine REMOTELY.

This means that I want to run a script on LinuxBox1 and have LinuxBox2 (another linux server on same LAN) shut down.

A. Actually SSH would have to be set up first to allow passwordless, login between servers.

I found the solution else where, and just wanted to post it here, in case anyone else stubles on this question looking for an answer.

NOTE: IN THE RESOLUTION BELOW MANY OF THE COMMANDS ARE CUT OFF, OR INCORECTULY SHOW AS TWO LINES. FOLLOW THIS LINK FOR A PROPERLY FORMATED ANSWER.
http://www.justlinux.com/forum/showthread.php?p=863427#post863427

RESOLUTION:
Here's what I did...

First I ssh'd from each machine to each other one. (The first time u ssh to new machine it asked you to accept the machines "fingerprint" and saves it -- this is just so they know who each other are.

Then on the machine I wanted to be able to shutdown FROM I did
[CODE]
cd /root/.ssh/
ssh-keygen -t rsa
[/CODE]
and accepted the default location. (/root/.ssh/id_rsa)
I left the passphrase blank, so it would not be required.

Then basically you just need to copy that "id_rsa" file onto the DESTINATION machine, in the same directory, but named as "authorized_keys". Which can easily be done like this:
[CODE]
scp id_rsa.pub xxx.xxx.xxx.xxx:/root/.ssh/authorized_keys [/CODE]
Where xxx.xxx.xxx.xxx is the IP address or host name of remote machine.

[INDENT]NOTE: You may want to check if a file by that name already exists, on the remote machine, because the above command will overwrite it without warning. -- If you already have a file by that name on the remote machine, I would suggest using command above, but change the file name. Then on the remote machine, append the file you just copied to the existing one. This could easily be done like this: (there may be an even simpler way - but this is what I know)

[CODE]mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.backup
cat /root/.ssh/authorized_keys.backup /root/.ssh/yourfilename > /root/.ssh/authorized_keys
[/CODE]
[/INDENT]

Then make sure the /root/.ssh/authorized_keys file has 600 permissions.
[CODE]
chmod 600 /root/.ssh/authorized_ keys
[/CODE]

Then try to ssh to the remote machine.
[CODE]
ssh xxx.xxx.xxx.xxx
[/CODE]
And if it works like it did for me -- it will let you right in, with no username or password. If this works correctly, you should be able to remotely run commands through ssh within scripts.

scp files from my school computer to my home computer?
Q. I just purchased an iMac for my home office and I want to copy files from my Linux machine at school to my iMac at home. My iMac is on a wireless router. I open up a terminal and use ssh, but I'm having issues copying files over. I tried scp filename username@home_ip_address:~ but it doesn't work. Any suggestions?

A. on your imac:
scp your_school_account@ \
your_school_machine:/home/juan/filename .
(two lines because Yahoo Answers didn't display it right)

or Charlie Kelly's method:
sftp your_school_account@your_school_machine
get filename

another option is to use a GUI if you prefer:
download Cyberduck, a free FTP client for Macs

How would you go about this linux task?
Q. 1. I must grep through executable scripts, but they don't end in .doc or .exe tag

2. the grep signature will be "rcp" other remote commands so I can change them secure commands like "scp"

Is there any way I could do this in Linux and using Perl?

A. find . -type f -perm /u+x -exec grep -l -w rcp {} \;

Find regular files starting at the current directory which are executable by the owner. When found grep on whole words of "rcp", but display only the file names.

If you really want to replace "rcp" with "scp" in all cases (not recommended because that is too sweeping), then add a sed loop. Something like this:


find . -type f -perm /u+x -exec grep -l -w rcp {} \; | while read NAME; do cat $NAME | sed -e 's/rcp /scp /g' > .tmp.$$ ; mv .tmp.$$ $NAME; done

Be SURE to test that thoroughly before trying that last bit.



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Monday, March 11, 2013

I am accessing my home linux box remotely from work. How can I copy files from that linux comp to my local com

Q. I am accessing my home linux computer remotely from my MacBook via SSH. I am behind a NAT, so I don't have a static IP. I want to retrieve some files from that linux box to my MacBook. Is there a reverse SCP command that I can use so that I can SCP the file from my home linux box to my MacBook at work through the already established tunnel?

A. You use scp direct (not through the tunnel). It can copy either way. One option is to log in to your Linux box through ssh, then use scp to the Mac from there. you would need the address of the mac, and forwarding set up at its' router. Alternatively use the scp from the mac console to your Linux machine. You must have its' address if you can ssh to it.

Is there a way to easily shutdown a remote linux server with a shell script?
Q. I have 3 linux servers hooked to my UPS. I can only hook the UPS to one of them. The UPS software will allow me to run a shell script on that one server before it shuts down. And I want that shell script to shut down the other 2 servers. Is this possible?
@ Roland J: I AM FULLY AWARE OF HOW TO SHUTDOWN A LINUX MACHINE.

@ Roland J: Please donât answer a question unless you actually READ the question!!!!! It makes other people think the question is answered, when in reality, your just lazy to even read the full title of the question. (or you donât know what the word âremoteâ means)

I need to know how to shutdown a linux machine REMOTELY.

This means that I want to run a script on LinuxBox1 and have LinuxBox2 (another linux server on same LAN) shut down.

A. Actually SSH would have to be set up first to allow passwordless, login between servers.

I found the solution else where, and just wanted to post it here, in case anyone else stubles on this question looking for an answer.

NOTE: IN THE RESOLUTION BELOW MANY OF THE COMMANDS ARE CUT OFF, OR INCORECTULY SHOW AS TWO LINES. FOLLOW THIS LINK FOR A PROPERLY FORMATED ANSWER.
http://www.justlinux.com/forum/showthread.php?p=863427#post863427

RESOLUTION:
Here's what I did...

First I ssh'd from each machine to each other one. (The first time u ssh to new machine it asked you to accept the machines "fingerprint" and saves it -- this is just so they know who each other are.

Then on the machine I wanted to be able to shutdown FROM I did
[CODE]
cd /root/.ssh/
ssh-keygen -t rsa
[/CODE]
and accepted the default location. (/root/.ssh/id_rsa)
I left the passphrase blank, so it would not be required.

Then basically you just need to copy that "id_rsa" file onto the DESTINATION machine, in the same directory, but named as "authorized_keys". Which can easily be done like this:
[CODE]
scp id_rsa.pub xxx.xxx.xxx.xxx:/root/.ssh/authorized_keys [/CODE]
Where xxx.xxx.xxx.xxx is the IP address or host name of remote machine.

[INDENT]NOTE: You may want to check if a file by that name already exists, on the remote machine, because the above command will overwrite it without warning. -- If you already have a file by that name on the remote machine, I would suggest using command above, but change the file name. Then on the remote machine, append the file you just copied to the existing one. This could easily be done like this: (there may be an even simpler way - but this is what I know)

[CODE]mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.backup
cat /root/.ssh/authorized_keys.backup /root/.ssh/yourfilename > /root/.ssh/authorized_keys
[/CODE]
[/INDENT]

Then make sure the /root/.ssh/authorized_keys file has 600 permissions.
[CODE]
chmod 600 /root/.ssh/authorized_ keys
[/CODE]

Then try to ssh to the remote machine.
[CODE]
ssh xxx.xxx.xxx.xxx
[/CODE]
And if it works like it did for me -- it will let you right in, with no username or password. If this works correctly, you should be able to remotely run commands through ssh within scripts.

scp files from my school computer to my home computer?
Q. I just purchased an iMac for my home office and I want to copy files from my Linux machine at school to my iMac at home. My iMac is on a wireless router. I open up a terminal and use ssh, but I'm having issues copying files over. I tried scp filename username@home_ip_address:~ but it doesn't work. Any suggestions?

A. on your imac:
scp your_school_account@ \
your_school_machine:/home/juan/filename .
(two lines because Yahoo Answers didn't display it right)

or Charlie Kelly's method:
sftp your_school_account@your_school_machine
get filename

another option is to use a GUI if you prefer:
download Cyberduck, a free FTP client for Macs



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Tuesday, March 5, 2013

How would you go about this linux task?

Q. 1. I must grep through executable scripts, but they don't end in .doc or .exe tag

2. the grep signature will be "rcp" other remote commands so I can change them secure commands like "scp"

Is there any way I could do this in Linux and using Perl?

A. find . -type f -perm /u+x -exec grep -l -w rcp {} \;

Find regular files starting at the current directory which are executable by the owner. When found grep on whole words of "rcp", but display only the file names.

If you really want to replace "rcp" with "scp" in all cases (not recommended because that is too sweeping), then add a sed loop. Something like this:


find . -type f -perm /u+x -exec grep -l -w rcp {} \; | while read NAME; do cat $NAME | sed -e 's/rcp /scp /g' > .tmp.$$ ; mv .tmp.$$ $NAME; done

Be SURE to test that thoroughly before trying that last bit.

How do I turn my Ubuntu/Linux PC into a server for my Windows 7 PC?
Q. Is this a good idea? Will my Windows PC get extra protection since I will be going on the Internet using the Ubuntu as a server, as an intermediary? How difficult is it to do this?

A. This question is pretty poorly designed. There is no "Server for windows" in Linux. You can do several things with linux and connect/use them from windows though. You can make linux a firewall and router, connect it to your cable/dsl modem so you can have multiple computers use your internet connection at one time. You can run web, ftp, and other servers for files and web pages. You can also run Samba which allows you to access and store files on the linux hard driver over the network. linux also makes a GREAT extension to your windows environment using things like xdmcp, rdp, ssh, scp. if you do not know what any of these terms are, google is your buddy. You can also set up a web proxy using linux and this could definitely be used to increase your web browsing security in windows by blocking malicious web sites. Pretty much anything you want to do with Linux is limited by you and your willingness to learn.

Nothing is simple click and go in linux. You have to be willing to experiemnt, read, and learn.

How do you transfer files from the command line in Red Hat Linux?
Q. I'm trying to transfer files from a Fedora Core to the host server, which is a Red Hat v 8. How do I do it from the command line?

A. Well there are several ways to do this. They depend on what servers are running on the host machine. If you can ssh to the host server, then the best way is "scp <filename> <host machine>:<filename>". If this is not setup you can try ftp or one of the disk sharing protocols like Samba or NFS.



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Saturday, March 2, 2013

How hard is it to run a secure Linux server, with Apache, PHP, MySQL, and mail services?

Q. I will be getting my own dedicated server soon and while I have a functional knowledge of the concepts of Linux, I don't know everything. Will my server be reasonably secure if I am sure to keep everything updated and patched (assume there are no PHP scripts vulnerable to SQL injection etc.)

A. Make sure you have strong passwords for everything. This includes your database. Use SSH to connect, scp or some other secure program to transfer files (not vanilla FTP, since it transmits passwords in the clear).
If your database doesn't need to talk to other hosts, configure it so it only listens on the loopback interface.
Be careful when configuring your mail server, so it isn't an open relay.
Get a cert for the web server, so you can use SSL to protect information that gets sent over the net.

The biggest potential source of vulnerabilities will be from whatever web apps you install. Subscribe to the announcement/security mailing list(s) for those apps (and for the Linux distro you use), so you don't get blindsided. Before you install something, you might want to check out a security site (like Secunia) and search to see what advisories have been issued for that software w/in the recent past. This will give you an idea about just how worried you should be about potential issues down the road (and what current issues there are that haven't been fixed, yet).

If you're rolling your own web apps, there are a whole bunch of things to watch out for, especially if you're doing things with user data (file uploads, SQL searches, form processing, etc).

How do I upload a folder recursively via SSH through a linux terminal?
Q. The problem is quite simple actually. I have a folder in my desktop which I want to be able to upload to my server via SSH. I want to be able to do that using only the linux terminal. Thanks
I don't know about import/export functions. I just want to upload via SSH. I know it's possible, I just don't know how.

A. See the SCP command (syntax in source link). It copies files over ssh. As you can see, it has an option to put an entire folder over at once.

Alternatively, there's SFTP (secure-ftp) which tunnels a ftp connection through ssh (valid only if the target server also has ftp service in addition to ssh).

How do I transfer files to and from my computer I'm remotely connected to through SSH?
Q. I want to be able to transfer files to and from my home computer remotely while accessing it from an SSH connection...How do I do this? Do I need to set up an FTP server on my home computer? It's running Debian Linux and I access it from my Android phone using ConnectBot.

A. If it's running an ssh server that will include scp and usually sftp.
You can connect with any scp/sftp client like winscp, rsync. If you set up SSH keys access you need not bother with passwords (though it's still a good idea to have some passphrase in case you lose the phone)

ftp is less secure, unless you use SSL



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Friday, February 22, 2013

I am accessing my home linux box remotely from work. How can I copy files from that linux comp to my local com

Q. I am accessing my home linux computer remotely from my MacBook via SSH. I am behind a NAT, so I don't have a static IP. I want to retrieve some files from that linux box to my MacBook. Is there a reverse SCP command that I can use so that I can SCP the file from my home linux box to my MacBook at work through the already established tunnel?

A. You use scp direct (not through the tunnel). It can copy either way. One option is to log in to your Linux box through ssh, then use scp to the Mac from there. you would need the address of the mac, and forwarding set up at its' router. Alternatively use the scp from the mac console to your Linux machine. You must have its' address if you can ssh to it.

Is there a way to easily shutdown a remote linux server with a shell script?
Q. I have 3 linux servers hooked to my UPS. I can only hook the UPS to one of them. The UPS software will allow me to run a shell script on that one server before it shuts down. And I want that shell script to shut down the other 2 servers. Is this possible?
@ Roland J: I AM FULLY AWARE OF HOW TO SHUTDOWN A LINUX MACHINE.

@ Roland J: Please donât answer a question unless you actually READ the question!!!!! It makes other people think the question is answered, when in reality, your just lazy to even read the full title of the question. (or you donât know what the word âremoteâ means)

I need to know how to shutdown a linux machine REMOTELY.

This means that I want to run a script on LinuxBox1 and have LinuxBox2 (another linux server on same LAN) shut down.

A. Actually SSH would have to be set up first to allow passwordless, login between servers.

I found the solution else where, and just wanted to post it here, in case anyone else stubles on this question looking for an answer.

NOTE: IN THE RESOLUTION BELOW MANY OF THE COMMANDS ARE CUT OFF, OR INCORECTULY SHOW AS TWO LINES. FOLLOW THIS LINK FOR A PROPERLY FORMATED ANSWER.
http://www.justlinux.com/forum/showthread.php?p=863427#post863427

RESOLUTION:
Here's what I did...

First I ssh'd from each machine to each other one. (The first time u ssh to new machine it asked you to accept the machines "fingerprint" and saves it -- this is just so they know who each other are.

Then on the machine I wanted to be able to shutdown FROM I did
[CODE]
cd /root/.ssh/
ssh-keygen -t rsa
[/CODE]
and accepted the default location. (/root/.ssh/id_rsa)
I left the passphrase blank, so it would not be required.

Then basically you just need to copy that "id_rsa" file onto the DESTINATION machine, in the same directory, but named as "authorized_keys". Which can easily be done like this:
[CODE]
scp id_rsa.pub xxx.xxx.xxx.xxx:/root/.ssh/authorized_keys [/CODE]
Where xxx.xxx.xxx.xxx is the IP address or host name of remote machine.

[INDENT]NOTE: You may want to check if a file by that name already exists, on the remote machine, because the above command will overwrite it without warning. -- If you already have a file by that name on the remote machine, I would suggest using command above, but change the file name. Then on the remote machine, append the file you just copied to the existing one. This could easily be done like this: (there may be an even simpler way - but this is what I know)

[CODE]mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.backup
cat /root/.ssh/authorized_keys.backup /root/.ssh/yourfilename > /root/.ssh/authorized_keys
[/CODE]
[/INDENT]

Then make sure the /root/.ssh/authorized_keys file has 600 permissions.
[CODE]
chmod 600 /root/.ssh/authorized_ keys
[/CODE]

Then try to ssh to the remote machine.
[CODE]
ssh xxx.xxx.xxx.xxx
[/CODE]
And if it works like it did for me -- it will let you right in, with no username or password. If this works correctly, you should be able to remotely run commands through ssh within scripts.

scp files from my school computer to my home computer?
Q. I just purchased an iMac for my home office and I want to copy files from my Linux machine at school to my iMac at home. My iMac is on a wireless router. I open up a terminal and use ssh, but I'm having issues copying files over. I tried scp filename username@home_ip_address:~ but it doesn't work. Any suggestions?

A. on your imac:
scp your_school_account@ \
your_school_machine:/home/juan/filename .
(two lines because Yahoo Answers didn't display it right)

or Charlie Kelly's method:
sftp your_school_account@your_school_machine
get filename

another option is to use a GUI if you prefer:
download Cyberduck, a free FTP client for Macs



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Tuesday, February 5, 2013

How to save file to desktop using Linux commands.?

Q. I am a beginner to Linux commands. I use SSH to connect to a Linux server. What command can I use to save a text file on the server to my desktop? Example?

A. From your desktop, fire up a terminal, or use Cygwin if you're under Windows (make sure you have installed the openssh packages) :

scp <your_user_name>@<server_name>:<path to remote file> <path to local dir/file>

Enter your password, and you're done :)

How hard is it to run a secure Linux server, with Apache, PHP, MySQL, and mail services?
Q. I will be getting my own dedicated server soon and while I have a functional knowledge of the concepts of Linux, I don't know everything. Will my server be reasonably secure if I am sure to keep everything updated and patched (assume there are no PHP scripts vulnerable to SQL injection etc.)

A. Make sure you have strong passwords for everything. This includes your database. Use SSH to connect, scp or some other secure program to transfer files (not vanilla FTP, since it transmits passwords in the clear).
If your database doesn't need to talk to other hosts, configure it so it only listens on the loopback interface.
Be careful when configuring your mail server, so it isn't an open relay.
Get a cert for the web server, so you can use SSL to protect information that gets sent over the net.

The biggest potential source of vulnerabilities will be from whatever web apps you install. Subscribe to the announcement/security mailing list(s) for those apps (and for the Linux distro you use), so you don't get blindsided. Before you install something, you might want to check out a security site (like Secunia) and search to see what advisories have been issued for that software w/in the recent past. This will give you an idea about just how worried you should be about potential issues down the road (and what current issues there are that haven't been fixed, yet).

If you're rolling your own web apps, there are a whole bunch of things to watch out for, especially if you're doing things with user data (file uploads, SQL searches, form processing, etc).

How do I upload a folder recursively via SSH through a linux terminal?
Q. The problem is quite simple actually. I have a folder in my desktop which I want to be able to upload to my server via SSH. I want to be able to do that using only the linux terminal. Thanks
I don't know about import/export functions. I just want to upload via SSH. I know it's possible, I just don't know how.

A. See the SCP command (syntax in source link). It copies files over ssh. As you can see, it has an option to put an entire folder over at once.

Alternatively, there's SFTP (secure-ftp) which tunnels a ftp connection through ssh (valid only if the target server also has ftp service in addition to ssh).



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Monday, February 4, 2013

How would you go about this linux task?

Q. 1. I must grep through executable scripts, but they don't end in .doc or .exe tag

2. the grep signature will be "rcp" other remote commands so I can change them secure commands like "scp"

Is there any way I could do this in Linux and using Perl?

A. find . -type f -perm /u+x -exec grep -l -w rcp {} \;

Find regular files starting at the current directory which are executable by the owner. When found grep on whole words of "rcp", but display only the file names.

If you really want to replace "rcp" with "scp" in all cases (not recommended because that is too sweeping), then add a sed loop. Something like this:


find . -type f -perm /u+x -exec grep -l -w rcp {} \; | while read NAME; do cat $NAME | sed -e 's/rcp /scp /g' > .tmp.$$ ; mv .tmp.$$ $NAME; done

Be SURE to test that thoroughly before trying that last bit.

How do I turn my Ubuntu/Linux PC into a server for my Windows 7 PC?
Q. Is this a good idea? Will my Windows PC get extra protection since I will be going on the Internet using the Ubuntu as a server, as an intermediary? How difficult is it to do this?

A. This question is pretty poorly designed. There is no "Server for windows" in Linux. You can do several things with linux and connect/use them from windows though. You can make linux a firewall and router, connect it to your cable/dsl modem so you can have multiple computers use your internet connection at one time. You can run web, ftp, and other servers for files and web pages. You can also run Samba which allows you to access and store files on the linux hard driver over the network. linux also makes a GREAT extension to your windows environment using things like xdmcp, rdp, ssh, scp. if you do not know what any of these terms are, google is your buddy. You can also set up a web proxy using linux and this could definitely be used to increase your web browsing security in windows by blocking malicious web sites. Pretty much anything you want to do with Linux is limited by you and your willingness to learn.

Nothing is simple click and go in linux. You have to be willing to experiemnt, read, and learn.

How do you transfer files from the command line in Red Hat Linux?
Q. I'm trying to transfer files from a Fedora Core to the host server, which is a Red Hat v 8. How do I do it from the command line?

A. Well there are several ways to do this. They depend on what servers are running on the host machine. If you can ssh to the host server, then the best way is "scp <filename> <host machine>:<filename>". If this is not setup you can try ftp or one of the disk sharing protocols like Samba or NFS.



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Saturday, February 2, 2013

Is there a way to easily shutdown a remote linux server with a shell script?

Q. I have 3 linux servers hooked to my UPS. I can only hook the UPS to one of them. The UPS software will allow me to run a shell script on that one server before it shuts down. And I want that shell script to shut down the other 2 servers. Is this possible?
@ Roland J: I AM FULLY AWARE OF HOW TO SHUTDOWN A LINUX MACHINE.

@ Roland J: Please donât answer a question unless you actually READ the question!!!!! It makes other people think the question is answered, when in reality, your just lazy to even read the full title of the question. (or you donât know what the word âremoteâ means)

I need to know how to shutdown a linux machine REMOTELY.

This means that I want to run a script on LinuxBox1 and have LinuxBox2 (another linux server on same LAN) shut down.

A. Actually SSH would have to be set up first to allow passwordless, login between servers.

I found the solution else where, and just wanted to post it here, in case anyone else stubles on this question looking for an answer.

NOTE: IN THE RESOLUTION BELOW MANY OF THE COMMANDS ARE CUT OFF, OR INCORECTULY SHOW AS TWO LINES. FOLLOW THIS LINK FOR A PROPERLY FORMATED ANSWER.
http://www.justlinux.com/forum/showthread.php?p=863427#post863427

RESOLUTION:
Here's what I did...

First I ssh'd from each machine to each other one. (The first time u ssh to new machine it asked you to accept the machines "fingerprint" and saves it -- this is just so they know who each other are.

Then on the machine I wanted to be able to shutdown FROM I did
[CODE]
cd /root/.ssh/
ssh-keygen -t rsa
[/CODE]
and accepted the default location. (/root/.ssh/id_rsa)
I left the passphrase blank, so it would not be required.

Then basically you just need to copy that "id_rsa" file onto the DESTINATION machine, in the same directory, but named as "authorized_keys". Which can easily be done like this:
[CODE]
scp id_rsa.pub xxx.xxx.xxx.xxx:/root/.ssh/authorized_keys [/CODE]
Where xxx.xxx.xxx.xxx is the IP address or host name of remote machine.

[INDENT]NOTE: You may want to check if a file by that name already exists, on the remote machine, because the above command will overwrite it without warning. -- If you already have a file by that name on the remote machine, I would suggest using command above, but change the file name. Then on the remote machine, append the file you just copied to the existing one. This could easily be done like this: (there may be an even simpler way - but this is what I know)

[CODE]mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.backup
cat /root/.ssh/authorized_keys.backup /root/.ssh/yourfilename > /root/.ssh/authorized_keys
[/CODE]
[/INDENT]

Then make sure the /root/.ssh/authorized_keys file has 600 permissions.
[CODE]
chmod 600 /root/.ssh/authorized_ keys
[/CODE]

Then try to ssh to the remote machine.
[CODE]
ssh xxx.xxx.xxx.xxx
[/CODE]
And if it works like it did for me -- it will let you right in, with no username or password. If this works correctly, you should be able to remotely run commands through ssh within scripts.

scp files from my school computer to my home computer?
Q. I just purchased an iMac for my home office and I want to copy files from my Linux machine at school to my iMac at home. My iMac is on a wireless router. I open up a terminal and use ssh, but I'm having issues copying files over. I tried scp filename username@home_ip_address:~ but it doesn't work. Any suggestions?

A. on your imac:
scp your_school_account@ \
your_school_machine:/home/juan/filename .
(two lines because Yahoo Answers didn't display it right)

or Charlie Kelly's method:
sftp your_school_account@your_school_machine
get filename

another option is to use a GUI if you prefer:
download Cyberduck, a free FTP client for Macs

How would you go about this linux task?
Q. 1. I must grep through executable scripts, but they don't end in .doc or .exe tag

2. the grep signature will be "rcp" other remote commands so I can change them secure commands like "scp"

Is there any way I could do this in Linux and using Perl?

A. find . -type f -perm /u+x -exec grep -l -w rcp {} \;

Find regular files starting at the current directory which are executable by the owner. When found grep on whole words of "rcp", but display only the file names.

If you really want to replace "rcp" with "scp" in all cases (not recommended because that is too sweeping), then add a sed loop. Something like this:


find . -type f -perm /u+x -exec grep -l -w rcp {} \; | while read NAME; do cat $NAME | sed -e 's/rcp /scp /g' > .tmp.$$ ; mv .tmp.$$ $NAME; done

Be SURE to test that thoroughly before trying that last bit.



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Friday, February 1, 2013

How to save file to desktop using Linux commands.?

Q. I am a beginner to Linux commands. I use SSH to connect to a Linux server. What command can I use to save a text file on the server to my desktop? Example?

A. From your desktop, fire up a terminal, or use Cygwin if you're under Windows (make sure you have installed the openssh packages) :

scp <your_user_name>@<server_name>:<path to remote file> <path to local dir/file>

Enter your password, and you're done :)

How hard is it to run a secure Linux server, with Apache, PHP, MySQL, and mail services?
Q. I will be getting my own dedicated server soon and while I have a functional knowledge of the concepts of Linux, I don't know everything. Will my server be reasonably secure if I am sure to keep everything updated and patched (assume there are no PHP scripts vulnerable to SQL injection etc.)

A. Make sure you have strong passwords for everything. This includes your database. Use SSH to connect, scp or some other secure program to transfer files (not vanilla FTP, since it transmits passwords in the clear).
If your database doesn't need to talk to other hosts, configure it so it only listens on the loopback interface.
Be careful when configuring your mail server, so it isn't an open relay.
Get a cert for the web server, so you can use SSL to protect information that gets sent over the net.

The biggest potential source of vulnerabilities will be from whatever web apps you install. Subscribe to the announcement/security mailing list(s) for those apps (and for the Linux distro you use), so you don't get blindsided. Before you install something, you might want to check out a security site (like Secunia) and search to see what advisories have been issued for that software w/in the recent past. This will give you an idea about just how worried you should be about potential issues down the road (and what current issues there are that haven't been fixed, yet).

If you're rolling your own web apps, there are a whole bunch of things to watch out for, especially if you're doing things with user data (file uploads, SQL searches, form processing, etc).

How do I upload a folder recursively via SSH through a linux terminal?
Q. The problem is quite simple actually. I have a folder in my desktop which I want to be able to upload to my server via SSH. I want to be able to do that using only the linux terminal. Thanks
I don't know about import/export functions. I just want to upload via SSH. I know it's possible, I just don't know how.

A. See the SCP command (syntax in source link). It copies files over ssh. As you can see, it has an option to put an entire folder over at once.

Alternatively, there's SFTP (secure-ftp) which tunnels a ftp connection through ssh (valid only if the target server also has ftp service in addition to ssh).



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Sunday, January 27, 2013

How to save file to desktop using Linux commands.?

Q. I am a beginner to Linux commands. I use SSH to connect to a Linux server. What command can I use to save a text file on the server to my desktop? Example?

A. From your desktop, fire up a terminal, or use Cygwin if you're under Windows (make sure you have installed the openssh packages) :

scp <your_user_name>@<server_name>:<path to remote file> <path to local dir/file>

Enter your password, and you're done :)

How hard is it to run a secure Linux server, with Apache, PHP, MySQL, and mail services?
Q. I will be getting my own dedicated server soon and while I have a functional knowledge of the concepts of Linux, I don't know everything. Will my server be reasonably secure if I am sure to keep everything updated and patched (assume there are no PHP scripts vulnerable to SQL injection etc.)

A. Make sure you have strong passwords for everything. This includes your database. Use SSH to connect, scp or some other secure program to transfer files (not vanilla FTP, since it transmits passwords in the clear).
If your database doesn't need to talk to other hosts, configure it so it only listens on the loopback interface.
Be careful when configuring your mail server, so it isn't an open relay.
Get a cert for the web server, so you can use SSL to protect information that gets sent over the net.

The biggest potential source of vulnerabilities will be from whatever web apps you install. Subscribe to the announcement/security mailing list(s) for those apps (and for the Linux distro you use), so you don't get blindsided. Before you install something, you might want to check out a security site (like Secunia) and search to see what advisories have been issued for that software w/in the recent past. This will give you an idea about just how worried you should be about potential issues down the road (and what current issues there are that haven't been fixed, yet).

If you're rolling your own web apps, there are a whole bunch of things to watch out for, especially if you're doing things with user data (file uploads, SQL searches, form processing, etc).

How do I upload a folder recursively via SSH through a linux terminal?
Q. The problem is quite simple actually. I have a folder in my desktop which I want to be able to upload to my server via SSH. I want to be able to do that using only the linux terminal. Thanks
I don't know about import/export functions. I just want to upload via SSH. I know it's possible, I just don't know how.

A. See the SCP command (syntax in source link). It copies files over ssh. As you can see, it has an option to put an entire folder over at once.

Alternatively, there's SFTP (secure-ftp) which tunnels a ftp connection through ssh (valid only if the target server also has ftp service in addition to ssh).



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Saturday, January 26, 2013

Is there a way to easily shutdown a remote linux server with a shell script?

Q. I have 3 linux servers hooked to my UPS. I can only hook the UPS to one of them. The UPS software will allow me to run a shell script on that one server before it shuts down. And I want that shell script to shut down the other 2 servers. Is this possible?
@ Roland J: I AM FULLY AWARE OF HOW TO SHUTDOWN A LINUX MACHINE.

@ Roland J: Please donât answer a question unless you actually READ the question!!!!! It makes other people think the question is answered, when in reality, your just lazy to even read the full title of the question. (or you donât know what the word âremoteâ means)

I need to know how to shutdown a linux machine REMOTELY.

This means that I want to run a script on LinuxBox1 and have LinuxBox2 (another linux server on same LAN) shut down.

A. Actually SSH would have to be set up first to allow passwordless, login between servers.

I found the solution else where, and just wanted to post it here, in case anyone else stubles on this question looking for an answer.

NOTE: IN THE RESOLUTION BELOW MANY OF THE COMMANDS ARE CUT OFF, OR INCORECTULY SHOW AS TWO LINES. FOLLOW THIS LINK FOR A PROPERLY FORMATED ANSWER.
http://www.justlinux.com/forum/showthread.php?p=863427#post863427

RESOLUTION:
Here's what I did...

First I ssh'd from each machine to each other one. (The first time u ssh to new machine it asked you to accept the machines "fingerprint" and saves it -- this is just so they know who each other are.

Then on the machine I wanted to be able to shutdown FROM I did
[CODE]
cd /root/.ssh/
ssh-keygen -t rsa
[/CODE]
and accepted the default location. (/root/.ssh/id_rsa)
I left the passphrase blank, so it would not be required.

Then basically you just need to copy that "id_rsa" file onto the DESTINATION machine, in the same directory, but named as "authorized_keys". Which can easily be done like this:
[CODE]
scp id_rsa.pub xxx.xxx.xxx.xxx:/root/.ssh/authorized_keys [/CODE]
Where xxx.xxx.xxx.xxx is the IP address or host name of remote machine.

[INDENT]NOTE: You may want to check if a file by that name already exists, on the remote machine, because the above command will overwrite it without warning. -- If you already have a file by that name on the remote machine, I would suggest using command above, but change the file name. Then on the remote machine, append the file you just copied to the existing one. This could easily be done like this: (there may be an even simpler way - but this is what I know)

[CODE]mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.backup
cat /root/.ssh/authorized_keys.backup /root/.ssh/yourfilename > /root/.ssh/authorized_keys
[/CODE]
[/INDENT]

Then make sure the /root/.ssh/authorized_keys file has 600 permissions.
[CODE]
chmod 600 /root/.ssh/authorized_ keys
[/CODE]

Then try to ssh to the remote machine.
[CODE]
ssh xxx.xxx.xxx.xxx
[/CODE]
And if it works like it did for me -- it will let you right in, with no username or password. If this works correctly, you should be able to remotely run commands through ssh within scripts.

scp files from my school computer to my home computer?
Q. I just purchased an iMac for my home office and I want to copy files from my Linux machine at school to my iMac at home. My iMac is on a wireless router. I open up a terminal and use ssh, but I'm having issues copying files over. I tried scp filename username@home_ip_address:~ but it doesn't work. Any suggestions?

A. on your imac:
scp your_school_account@ \
your_school_machine:/home/juan/filename .
(two lines because Yahoo Answers didn't display it right)

or Charlie Kelly's method:
sftp your_school_account@your_school_machine
get filename

another option is to use a GUI if you prefer:
download Cyberduck, a free FTP client for Macs

How would you go about this linux task?
Q. 1. I must grep through executable scripts, but they don't end in .doc or .exe tag

2. the grep signature will be "rcp" other remote commands so I can change them secure commands like "scp"

Is there any way I could do this in Linux and using Perl?

A. find . -type f -perm /u+x -exec grep -l -w rcp {} \;

Find regular files starting at the current directory which are executable by the owner. When found grep on whole words of "rcp", but display only the file names.

If you really want to replace "rcp" with "scp" in all cases (not recommended because that is too sweeping), then add a sed loop. Something like this:


find . -type f -perm /u+x -exec grep -l -w rcp {} \; | while read NAME; do cat $NAME | sed -e 's/rcp /scp /g' > .tmp.$$ ; mv .tmp.$$ $NAME; done

Be SURE to test that thoroughly before trying that last bit.



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Wednesday, January 23, 2013

How do I turn my Ubuntu/Linux PC into a server for my Windows 7 PC?

Q. Is this a good idea? Will my Windows PC get extra protection since I will be going on the Internet using the Ubuntu as a server, as an intermediary? How difficult is it to do this?

A. This question is pretty poorly designed. There is no "Server for windows" in Linux. You can do several things with linux and connect/use them from windows though. You can make linux a firewall and router, connect it to your cable/dsl modem so you can have multiple computers use your internet connection at one time. You can run web, ftp, and other servers for files and web pages. You can also run Samba which allows you to access and store files on the linux hard driver over the network. linux also makes a GREAT extension to your windows environment using things like xdmcp, rdp, ssh, scp. if you do not know what any of these terms are, google is your buddy. You can also set up a web proxy using linux and this could definitely be used to increase your web browsing security in windows by blocking malicious web sites. Pretty much anything you want to do with Linux is limited by you and your willingness to learn.

Nothing is simple click and go in linux. You have to be willing to experiemnt, read, and learn.

How do you transfer files from the command line in Red Hat Linux?
Q. I'm trying to transfer files from a Fedora Core to the host server, which is a Red Hat v 8. How do I do it from the command line?

A. Well there are several ways to do this. They depend on what servers are running on the host machine. If you can ssh to the host server, then the best way is "scp <filename> <host machine>:<filename>". If this is not setup you can try ftp or one of the disk sharing protocols like Samba or NFS.

What is the difference between the scp and sftp utilities in Linux?
Q.

A. man scp
man sftp



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

How do I turn my Ubuntu/Linux PC into a server for my Windows 7 PC?

Q. Is this a good idea? Will my Windows PC get extra protection since I will be going on the Internet using the Ubuntu as a server, as an intermediary? How difficult is it to do this?

A. This question is pretty poorly designed. There is no "Server for windows" in Linux. You can do several things with linux and connect/use them from windows though. You can make linux a firewall and router, connect it to your cable/dsl modem so you can have multiple computers use your internet connection at one time. You can run web, ftp, and other servers for files and web pages. You can also run Samba which allows you to access and store files on the linux hard driver over the network. linux also makes a GREAT extension to your windows environment using things like xdmcp, rdp, ssh, scp. if you do not know what any of these terms are, google is your buddy. You can also set up a web proxy using linux and this could definitely be used to increase your web browsing security in windows by blocking malicious web sites. Pretty much anything you want to do with Linux is limited by you and your willingness to learn.

Nothing is simple click and go in linux. You have to be willing to experiemnt, read, and learn.

How do you transfer files from the command line in Red Hat Linux?
Q. I'm trying to transfer files from a Fedora Core to the host server, which is a Red Hat v 8. How do I do it from the command line?

A. Well there are several ways to do this. They depend on what servers are running on the host machine. If you can ssh to the host server, then the best way is "scp <filename> <host machine>:<filename>". If this is not setup you can try ftp or one of the disk sharing protocols like Samba or NFS.

What is the difference between the scp and sftp utilities in Linux?
Q.

A. man scp
man sftp



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Is there a way to easily shutdown a remote linux server with a shell script?

Q. I have 3 linux servers hooked to my UPS. I can only hook the UPS to one of them. The UPS software will allow me to run a shell script on that one server before it shuts down. And I want that shell script to shut down the other 2 servers. Is this possible?
@ Roland J: I AM FULLY AWARE OF HOW TO SHUTDOWN A LINUX MACHINE.

@ Roland J: Please donât answer a question unless you actually READ the question!!!!! It makes other people think the question is answered, when in reality, your just lazy to even read the full title of the question. (or you donât know what the word âremoteâ means)

I need to know how to shutdown a linux machine REMOTELY.

This means that I want to run a script on LinuxBox1 and have LinuxBox2 (another linux server on same LAN) shut down.

A. Actually SSH would have to be set up first to allow passwordless, login between servers.

I found the solution else where, and just wanted to post it here, in case anyone else stubles on this question looking for an answer.

NOTE: IN THE RESOLUTION BELOW MANY OF THE COMMANDS ARE CUT OFF, OR INCORECTULY SHOW AS TWO LINES. FOLLOW THIS LINK FOR A PROPERLY FORMATED ANSWER.
http://www.justlinux.com/forum/showthread.php?p=863427#post863427

RESOLUTION:
Here's what I did...

First I ssh'd from each machine to each other one. (The first time u ssh to new machine it asked you to accept the machines "fingerprint" and saves it -- this is just so they know who each other are.

Then on the machine I wanted to be able to shutdown FROM I did
[CODE]
cd /root/.ssh/
ssh-keygen -t rsa
[/CODE]
and accepted the default location. (/root/.ssh/id_rsa)
I left the passphrase blank, so it would not be required.

Then basically you just need to copy that "id_rsa" file onto the DESTINATION machine, in the same directory, but named as "authorized_keys". Which can easily be done like this:
[CODE]
scp id_rsa.pub xxx.xxx.xxx.xxx:/root/.ssh/authorized_keys [/CODE]
Where xxx.xxx.xxx.xxx is the IP address or host name of remote machine.

[INDENT]NOTE: You may want to check if a file by that name already exists, on the remote machine, because the above command will overwrite it without warning. -- If you already have a file by that name on the remote machine, I would suggest using command above, but change the file name. Then on the remote machine, append the file you just copied to the existing one. This could easily be done like this: (there may be an even simpler way - but this is what I know)

[CODE]mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.backup
cat /root/.ssh/authorized_keys.backup /root/.ssh/yourfilename > /root/.ssh/authorized_keys
[/CODE]
[/INDENT]

Then make sure the /root/.ssh/authorized_keys file has 600 permissions.
[CODE]
chmod 600 /root/.ssh/authorized_ keys
[/CODE]

Then try to ssh to the remote machine.
[CODE]
ssh xxx.xxx.xxx.xxx
[/CODE]
And if it works like it did for me -- it will let you right in, with no username or password. If this works correctly, you should be able to remotely run commands through ssh within scripts.

scp files from my school computer to my home computer?
Q. I just purchased an iMac for my home office and I want to copy files from my Linux machine at school to my iMac at home. My iMac is on a wireless router. I open up a terminal and use ssh, but I'm having issues copying files over. I tried scp filename username@home_ip_address:~ but it doesn't work. Any suggestions?

A. on your imac:
scp your_school_account@ \
your_school_machine:/home/juan/filename .
(two lines because Yahoo Answers didn't display it right)

or Charlie Kelly's method:
sftp your_school_account@your_school_machine
get filename

another option is to use a GUI if you prefer:
download Cyberduck, a free FTP client for Macs

How would you go about this linux task?
Q. 1. I must grep through executable scripts, but they don't end in .doc or .exe tag

2. the grep signature will be "rcp" other remote commands so I can change them secure commands like "scp"

Is there any way I could do this in Linux and using Perl?

A. find . -type f -perm /u+x -exec grep -l -w rcp {} \;

Find regular files starting at the current directory which are executable by the owner. When found grep on whole words of "rcp", but display only the file names.

If you really want to replace "rcp" with "scp" in all cases (not recommended because that is too sweeping), then add a sed loop. Something like this:


find . -type f -perm /u+x -exec grep -l -w rcp {} \; | while read NAME; do cat $NAME | sed -e 's/rcp /scp /g' > .tmp.$$ ; mv .tmp.$$ $NAME; done

Be SURE to test that thoroughly before trying that last bit.



Nec Projector Review

Plastic Shed Reviews

Ati Graphic Reviews

Nurse Uniforms Reviews

Cabochons Reviews

Inflatable Water Slides Reviews

Barcode Scanner Reviews

Older Posts Home