LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Saving a file to desktop/Secure remote access from the command line/Fedora 15 (https://www.linuxquestions.org/questions/linux-newbie-8/saving-a-file-to-desktop-secure-remote-access-from-the-command-line-fedora-15-a-941587/)

DaverR 04-24-2012 10:38 PM

Saving a file to desktop/Secure remote access from the command line/Fedora 15
 
Hello again everyone. Just a couple of questions. From the command line, after I set the static ip address for the machine, how can I save that information to a file on the desktop? Another question, how do you set up secure remote access from the command line? Again, thanks for all your help.

rodrifra 04-25-2012 02:01 AM

Quote:

Originally Posted by DaverR (Post 4662305)
From the command line, after I set the static ip address for the machine, how can I save that information to a file on the desktop?

If you did it with ifconfig just for the session (This is for Debian like distros, check your own and modify it accordingly)

Code:

ifconfing -a > ~/Desktop/IPAdd.txt
If you modified your /etc/network/interfaces (Again for Debian like, in Fedora it might be /etc/sysconfig/network-scripts/ifcfg-eth1) you can make a link to that file and you will have the info.

Code:

ln -s /etc/network/interfaces ~/Desktop/IPAdd.txt
Quote:

how do you set up secure remote access from the command line?
I think the next comman should work in Fedora (run it as root).

Code:

yum install openssh-server
That will install the ssh server, which will give you remote secure access from the command line using ssh clients.

DaverR 04-25-2012 07:04 PM

Thanks for your reply rodrifra. I thought maybe I could figure it out with just the commands but after doing the research it just gets more confusing. What I am trying to do is create a bash script to connect to another machine remotely with a secure connection. I know that to do that I must use ssh. I just don't know how to get it started. The first question I posted will be part of the script but I think I can get that one ok. It is the ssh part that I have trouble with. The script will be based on user input and selections to initiate the connection. I welcome any suggestions. Thanks.

rodrifra 04-26-2012 08:22 AM

You can use 'here documents' to automate the conextion to the remote machine. To avoid the password authentication you will have to use public keys. To use public keys, just generate a public/private key pair with ssh-keygen (without passphrase). Send your public key over to the server you want to connect to and store it in the user's you will be connecting as under the .ssh directory in the authorized_keys file, and key your private key under $HOME/.ssh.


All times are GMT -5. The time now is 10:49 AM.