Sponsored Content
Special Forums UNIX and Linux Applications Regarding NFS server username/password authentication Post 302539734 by ajaypadvi on Monday 18th of July 2011 01:50:02 PM
Old 07-18-2011
Regarding NFS server username/password authentication

Hi;
I had set up NFS server in one ubuntu box and mounted few directories using it.
In order to access those directories across the network i m using j-ftp(an open source java network client) from other boxes in the same network.I am able to view my mounted directories in the server through it.
I want to know if there is a way in NFS server where by i can provide username/password authentication so that only authorized users will be able to view my mount share in NFS server.I searched the api of j-ftp client where i found "pcnfsd" may prove useful for it but i am not able to find any thing on that regarding NFS server authentication from client for Ubuntu.

following is the login method in the api of j-ftp:

com.sun.nfs
Class XFileExtensionAccessor

public boolean loginPCNFSD(String host,
String username,
String password)
Sets the user's RPC credential from Login name and password. Every NFS request includes a "credential" that identifies the user. An AUTH_SYS credential includes the user's UID and GID values. These are determined from the user's login name (and password) by the PCNFSD service that must be available on a local server. Once the credential is set, it is assigned globally to all future NFS XFile objects.
If this method is not called, a default credential is assigned with a UID and GID of "nobody".

Parameters:
Returns:
true if the login succeeded, false otherwise.

Please help me if der is ne way to provide an authentication from NFS server in Ubuntu box for which i will be very thankful.

Thanks in advance;
Ajay
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

username password in script

Can we write a script to telnet to a unix server from unix with the username and password hardcoded in the script?? something like ssh a@b -p password ??? (5 Replies)
Discussion started by: roshanjain2
5 Replies

2. Solaris

i wanto hardcode password for a username to ssh to a server using script

Dear all i want to ssh to a server via running a shell script with a username and i want to hard code the password for that particular username can u help me please Thank u Naree (8 Replies)
Discussion started by: naree
8 Replies

3. UNIX for Dummies Questions & Answers

How can i hide username/password

hi all, i run sqlplus command on unix(HP-UX) like "sqlplus username/password@serverA @deneme.sql" but when someone run "ps -ef | grep sqlplus", it can see my username and password :( How can i hide username and password. thanx. (1 Reply)
Discussion started by: temhem
1 Replies

4. Solaris

Solaris 9 as a nfs client -- centos as a nfs server.

Hello, I have a centos as nfs server, its name is centos_A. After I finish the setup of the nfs server, the other linux can access this nfs server immediately via /net/centos_A/* But, My solaris 9 can not access /net/centos_A/* immediately. I have to leave /net/centos_A, and wait for about... (1 Reply)
Discussion started by: bruceharbin
1 Replies

5. Shell Programming and Scripting

Username and password

Hi I am new to using unix and am struggling with a script i am writing. What i am trying to do is get a user to enter a username, check the original file i created with username and pin to see if their is a corresponding entry. Next ask the user to enter the pin and see if this matches... (5 Replies)
Discussion started by: somersetdan
5 Replies

6. UNIX for Dummies Questions & Answers

How do you reset username/password

Picked up a 3b2 running System V. Works fine, but it requires a username and password. Is the username "root" or "sysadm"? How do I find out and how to I reset it or bypass it? Thanks. (2 Replies)
Discussion started by: TanRuNomad
2 Replies

7. UNIX for Dummies Questions & Answers

Script to log in SFTP server [with username, password]

Hi, everyone, I am trying to write a script to login automatically using username and password to an sftp server (the key authentication has been disabled so I cannot use that method). I tried to search online for a solution and found a way using "expect" but my boss does not want me to use... (4 Replies)
Discussion started by: warmboy610
4 Replies

8. Shell Programming and Scripting

How to run commands on remote server using ssh password less authentication?

Hi, I need to run a script located in a directory on remote server by using ssh authentication from my local unix server. Can anyone help me in this. I have tried the below command. It worked for echo command but when i tried to open a file using cat command it is showing "cat: cannot open... (6 Replies)
Discussion started by: ssk250
6 Replies

9. Shell Programming and Scripting

How can i su automaticaly in same server with different username and same password?

Hi I am new to shell scripting, Can you please help me in writing a script that can switch user in same server with different user name and same password. I want to perform some functional task in a particular user and need to switch user and perform same activity in another user and so on ... ... (4 Replies)
Discussion started by: Dew
4 Replies
KNFS(1) 						       AFS Command Reference							   KNFS(1)

NAME
knfs - Establishes authenticated access via the NFS/AFS Translator SYNOPSIS
knfs -host <host name> [-id <user ID (decimal)>] [-sysname <host's '@sys' value>] [-unlog] [-tokens] [-help] knfs -ho <host name> [-i <user ID (decimal)>] [-s <host's '@sys' value>] [-u] [-t] [-he] DESCRIPTION
The knfs command creates an AFS credential structure on the local machine, identifying it by a process authentication group (PAG) number associated with the NFS client machine named by the -hostname argument and by default with a local UID on the NFS client machine that matches the issuer's local UID on the local machine. It places in the credential structure the AFS tokens that the issuer has previously obtained (by logging onto the local machine if an AFS-modified login utility is installed, by issuing the klog command, or both). To associate the credential structure with an NFS UID that does not match the issuer's local UID, use the -id argument. Issue this command only on the NFS(R)/AFS translator machine that is serving the NFS client machine, after obtaining AFS tokens on the translator machine for every cell to which authenticated access is required. The Cache Manager on the translator machine uses the tokens to obtain authenticated AFS access for the designated user working on the NFS client machine. This command is not effective if issued on an NFS client machine. To enable the user on the NFS client machine to issue AFS commands, use the -sysname argument to specify the NFS client machine's system type, which can differ from the translator machine's. The NFS client machine must be a system type for which AFS is supported. The -unlog flag discards the tokens in the credential structure, but does not destroy the credential structure itself. The Cache Manager on the translator machine retains the credential structure until the next reboot, and uses it each time the issuer accesses AFS through the translator machine. The credential structure only has tokens in it if the user reissues the knfs command on the translator machine each time the user logs into the NFS client machine. To display the tokens associated with the designated user on the NFS client machine, include the -tokens flag. Users working on NFS client machines of system types for which AFS binaries are available can use the klog command rather than the knfs command. CAUTIONS
If the translator machine's administrator has enabled UID checking by issuing the fs exportafs command with the -uidcheck on argument, it is not possible to use the -id argument to assign the tokens to an NFS UID that differs from the issuer's local UID. In this case, there is no point in including the -id argument, because the only acceptable value (the issuer's local UID) is the value used when the -id argument is omitted. Requiring matching UIDs is effective only when users have the same local UID on the translator machine as on NFS client machines. In that case, it guarantees that users assign their tokens only to their own NFS sessions. This command does not make it possible for users working on non-supported system types to issue AFS commands. This is possible only on NFS clients of a system type for which AFS is available. OPTIONS
-host <host name> Names the NFS client machine on which the issuer is to work. Providing a fully-qualified hostname is best, but abbreviated forms are possibly acceptable depending on the state of the cell's name server at the time the command is issued. -id <user ID (decimal)> Specifies the local UID on the NFS client to which to assign the tokens. The NFS client identifies file requests by the NFS UID, so creating the association enables the Cache Manager on the translator machine to use the appropriate tokens when filling the requests. If this argument is omitted, the command interpreter uses an NFS UID that matches the issuer's local UID on the translator machine (as returned by the getuid() function). -sysname <host's '@sys' value> Specifies the value that the local (translator) machine's remote executor daemon substitutes for the @sys variable in pathnames when executing AFS commands issued on the NFS client machine (which must be a supported system type). If the NFS user's PATH environment variable uses the @sys variable in the pathnames for directories that house AFS binaries (as recommended), then setting this argument enables NFS users to issue AFS commands by leading the remote executor daemon to access the AFS binaries appropriate to the NFS client machine even if its system type differs from the translator machine's. -unlog Discards the tokens stored in the credential structure identified by the PAG associated with the -host argument and, optionally, the -id argument. -tokens Displays the AFS tokens assigned to the designated user on the indicated NFS client machine. -help Prints the online help for this command. All other valid options are ignored. OUTPUT
The following error message indicates that UID checking is enabled on the translator machine and that the value provided for the -id argument differs from the issuer's local UID. knfs: Translator in 'passwd sync' mode; remote uid must be the same as local uid EXAMPLES
The following example illustrates a typical use of this command. The issuer "smith" is working on the machine "nfscli1.abc.com" and has user ID 1020 on that machine. The translator machine "tx4.abc.com" uses an AFS-modified login utility, so "smith" obtains tokens for the ABC Corporation cell automatically upon login via the telnet program. She then issues the klog command to obtain tokens as "admin" in the ABC Corporation's test cell, "test.abc.com", and the knfs command to associate both tokens with the credential structure identified by machine name "nfs-cli1" and user ID 1020. She breaks the connection to "tx4" and works on "nfscli1". % telnet tx4.abc.com . . . login: smith Password: AFS(R) login % klog admin -cell test.abc.com Password: % knfs nfscli1.abc.com 1020 % exit The following example shows user smith again connecting to the machine "tx4" via the telnet program and discarding the tokens. % telnet translator4.abc.com . . . login: smith Password: AFS(R) login % knfs nfscli1.abc.com 1020 -unlog % exit PRIVILEGE REQUIRED
None SEE ALSO
klog(1), pagsh(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 KNFS(1)
All times are GMT -4. The time now is 03:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy